Skip to content

Instantly share code, notes, and snippets.

@nikasulo
Created February 27, 2020 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikasulo/801e6d126cf7e926612e8f4d135e5bb7 to your computer and use it in GitHub Desktop.
Save nikasulo/801e6d126cf7e926612e8f4d135e5bb7 to your computer and use it in GitHub Desktop.
handleChange(e) {
const { target } = e;
if (target.id === "image") {
this.setState({image: e.target.files[0]});
return;
}
const value = target.value;
this.setState({[e.target.id]: value})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment