Skip to content

Instantly share code, notes, and snippets.

@vcarl
Last active December 8, 2015 20:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vcarl/3d158424656c440bbc87 to your computer and use it in GitHub Desktop.
Save vcarl/3d158424656c440bbc87 to your computer and use it in GitHub Desktop.
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