useSyncExternalStore connects an external store to React through subscribe and getSnapshot functions. Several components may read the same snapshot.
In the demo, two views update together when the central store changes. getSnapshot should return the same reference while data is unchanged; a fresh object each call can cause repeated updates.
When to use
Use it to subscribe to browser APIs, shared state libraries, or caches outside React.