Skip to content

Commit d310f42

Browse files
AWolf81Veekas Shrivastava
authored and
Veekas Shrivastava
committed
Corrected MyInput component value binding. (kentcdodds#1) (kentcdodds#7)
1 parent 680e553 commit d310f42

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)