State Management · Junior · Question 35 of 75

How do you update state in Zustand?

Explanation

set merges the returned object into the state at the top level (one level deep). Actions are usually defined right in the store, so components just call inc().

Further reading

Problem with a question

State Management · Junior · question 35

Test yourself

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

Take this quiz