useSyncExternalStore subscribes to external data stores in a way compatible with Concurrent Mode, ensuring the store updates are consistent with React’s rendering system.
useSyncExternalStore