State Management · Senior · Question 1 of 75

Why do Redux, Zustand and similar libraries subscribe through useSyncExternalStore?

Explanation

With concurrent rendering React may pause a render; if an external store changes meanwhile, some components could read old values and others new ones. useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) prevents that and supports SSR.

Further reading

Problem with a question

State Management · Senior · question 1

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