State Management · Middle · Question 59 of 75

What does the second argument true do in Zustand's set(newState, true)?

Explanation

By default set shallow-merges. Replace mode is useful for resets, but forgetting actions in the new object removes them from the store.

Further reading

Problem with a question

State Management · Middle · question 59

Test yourself

Take the State Management · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz