Skip to content

Instantly share code, notes, and snippets.

@vcarl
Last active Dec 8, 2015
Embed
What would you like to do?
change: function(field) {
return function(event) {
state = {};
state[field] = event.target.value;
this.setState(state);
}.bind(this)
}
// To use:
<input onChange={this.change('fieldName')} />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment