Hacker News new | ask | show | jobs
by voyager1 1225 days ago
Have you used React? You must copy every complex object or list everytime before you update the state.
1 comments

s/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-upda...

In Redux reducers, however, you need a full copy.