If you have an object in the state,
state = {
item: {
name: ''
}
}
How to use this design pattern to access the name property of the item object?
changeMe = (e) => this.setState( {[e.target.name]: e.target.value});
I tried changing the name to item.name but it just creates a state with item.name as key.
<Form.Control name="item.name" onChange={this.onChange} defaultValue={this.state.item.name}></Form.Control>