handleChange = (name) => ({ target }) => {
this.setState({ [name]: target.value });
};
handleChange = (name) => ({ target }) => {
this.setState({ [name]: target.value });
};
handleChange = function(name) {
return function({ target }) {
this.setState({ [name]: target.value });
};
};
handleChange = function(name) {
return function(obj) {
this.setState({ [name]: obj.target.value });
};
};
<input onChange={() => handleChange('name')} />