State Management · Senior · Question 1 of 75
Why do Redux, Zustand and similar libraries subscribe through useSyncExternalStore?
- ✓Correct answer: It guarantees a consistent snapshot during concurrent rendering (no tearing)
- 2It's the only hook that can trigger re-renders from outside React
- 3It caches the store in
localStoragebetween sessions
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.