Skip to content
This repository was archived by the owner on Feb 7, 2022. It is now read-only.

Commit 1d72a31

Browse files
AWolf81Kent C. Dodds
authored and
Kent C. Dodds
committed
Corrected MyInput component value binding. (#1) (#7)
1 parent 54cc11c commit 1d72a31

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)