onChange = (e) => { this.setState({ [e.target.name]: e.target.value }); } code example
Example: event.target.name in setstate
inputChangeHandler: function ({ target: { id, value }) {
this.setState({ [id]: value });
},
inputChangeHandler: function ({ target: { id, value }) {
this.setState({ [id]: value });
},