Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Last active September 2, 2018 07:14
Show Gist options
  • Select an option

  • Save agoiabel/9b8fb379f788512740b455ae7f4b6185 to your computer and use it in GitHub Desktop.

Select an option

Save agoiabel/9b8fb379f788512740b455ae7f4b6185 to your computer and use it in GitHub Desktop.
changeHandler = event => {
const name = event.target.name;
const value = event.target.value;
this.setState(prevState => {
return {
formControls: {
...prevState.formControls,
[name]: {
...prevState.formControls[name],
value: value
}
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment