What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-05 08:33:02
how to update state.item[1] in state using setState? React
handleChange: function (e) { // 1. Make a shallow copy of the items let items = [...this.state.items]; // 2. Make a shallow copy of the item you want to mutate let item = {...items[1]}; // 3. Replace the property you're intested in ... Add solution