React · Middle · Question 27 of 75
What is useSyncExternalStore for?
- ✓Correct answer: Subscribing to an external store without UI "tearing"
- 2Syncing state between browser tabs
- 3Synchronously loading data from the server during render
Explanation
The hook takes subscribe, getSnapshot and getServerSnapshot and guarantees a consistent value during concurrent rendering (no tearing). Redux, Zustand and similar libraries are built on it. Example: subscribing to navigator.onLine or localStorage.