3 ms·
Have you used React? You must copy every complex object or list everytime before you update the state.
by voyager1 4y ago
Have you used React? You must copy every complex object or list everytime before you update the state.
- nishs 4y agos/React/Redux? (for example) With setState in React, you don't necessarily have to copy to update the state. setState merges the partial object you provide with the current state. https://reactjs.org/docs/state-and-lifecycle.html#state-updates-are-merged https://reactjs.org/docs/state-and-lifecycle.html#state-upda... In Redux reducers, however, you need a full copy.