State Management · Middle · Question 59 of 75
What does the second argument true do in Zustand's set(newState, true)?
- ✓Correct answer: Replaces the whole state instead of merging, which also drops actions unless you include them
- 2Makes the update synchronous
- 3Persists the state
Explanation
By default set shallow-merges. Replace mode is useful for resets, but forgetting actions in the new object removes them from the store.