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

By | 15/04/2020

Warning: Undefined variable $button in H:\root\home\stelco-001\www\collinscreative\wordpress\wp-content\plugins\facebook-share-new\facebookshare.php on line 631

Warning: Undefined variable $content in H:\root\home\stelco-001\www\collinscreative\wordpress\wp-content\plugins\facebook-share-new\facebookshare.php on line 636

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