State Management · Senior · Question 16 of 75

Why is a module-level Zustand store dangerous in SSR (Next.js)?

Explanation

The Next.js guide recommends creating the store per request with createStore and passing it through a Context provider, then reading it with useStore(storeApi, selector). In a purely client SPA a global store is fine.

Further reading

Problem with a question

State Management · Senior · question 16

Test yourself

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

Take this quiz