I follow this example
react set state in for nested state
to set nested state in react. What's wrong with below code? I want e.target.name as the property of the object.
onChange = (e) => {
this.setState({
input: {...this.state.input, e.target.name: e.target.value}
})
}