Skip to content

Commit 7b1745a

Browse files
authored
Corrected MyInput component value binding. (#1)
1 parent 6ad119e commit 7b1745a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/exercises/13.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function MyInput() {
2525
<Rendux.Consumer>
2626
{rendux => (
2727
<input
28-
defaultValue={rendux.state.on ? 'on' : 'off'}
28+
value={rendux.state.inputValue || (rendux.state.on ? 'on' : 'off')}
2929
placeholder="Type 'off' or 'on'"
3030
onChange={event => {
3131
if (event.target.value === 'on') {

0 commit comments

Comments
 (0)