Created
July 26, 2016 05:50
-
-
Save vagusX/2c55b03d46eaa9027649d259d3c16708 to your computer and use it in GitHub Desktop.
react utils
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleChange = field => { | |
return e => { | |
const value = e.target ? e.target.value : e; | |
const newFormData = { ...this.state.formData }; | |
newFormData[field] = value; | |
this.setState({ | |
formData: newFormData | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment