Last active
March 1, 2018 23:10
-
-
Save lightsofapollo/46a3a4ec006985ae9780b19c96c6c01d 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
const handleChange = name => { | |
return e => { | |
this.setState({ | |
[name]: e.target.value, | |
}); | |
}; | |
}; | |
class Foo extends Component { | |
handleFooChange = handleChange('foo') | |
render() { | |
return <input onChange={handleFooChange} /> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment