Chapter 08, Exercise Practice3.js,
The code for the UserForm is given as const UserForm = props => (
: //Incorrect
);This seems incorrect. At least the last double quotes should be removed for the state to update. The works for me: for example,
: //REMOVED QUOTES
Seems like the code I typed have not come through. In essence, onChange = "{props.onChange}" does not allow state to update. The double quotes must be removed for the state to update.
@Ilya-Lad You are correct the double quotes need to be removed here. Created a PR: https://github.com/zgordon/react-book/pull/31
Same for id and htmlFor. it is given
<label htmlFor="{props.id}">{props.label}</label>: <input id="{props.id}" type="text" onChange="{props.onChange}" />
but should be
<label htmlFor={props.id}>{props.label}</label>: <input id={props.id} type="text" onChange={props.onChange} />