Last active
December 8, 2015 20:48
-
-
Save vcarl/3d158424656c440bbc87 to your computer and use it in GitHub Desktop.
This file contains 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
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