javascript – How to update nested state properties in React – Stack Overflow

By | 15/04/2020

https://stackoverflow.com/questions/43040721/how-to-update-nested-state-properties-in-react

this.setState(state => {
state.nested.flag = false
state.another.deep.prop = true
return state
})

Example of nested arrays in React state
https://codesandbox.io/s/nested-array-update-ucxb6?fontsize=14&file=/src/installer.jsx:3101-3161