A React hook that registers a handle for synchronization using a synchronized state object.
This hook will create a synchronized state object using the useSyncState hook with the given initial state and update event.
It will then register a handle with the given ID and the synchronized state object.
The handle will be unregistered when the component using the hook unmounts.
By default, only the hosting component will be updated when the state changes. Other components can consume this handle using useHandle
(if state updates do not need to trigger rerendering in the consumer, or if the consuming component will handle its own subscription),
or useSyncHandle to gain access to the handle in the consumer and get rerendering triggered.
A React hook that registers a handle for synchronization using a synchronized state object.
This hook will create a synchronized state object using the
useSyncStatehook with the given initial state and update event. It will then register a handle with the given ID and the synchronized state object. The handle will be unregistered when the component using the hook unmounts.By default, only the hosting component will be updated when the state changes. Other components can consume this handle using
useHandle(if state updates do not need to trigger rerendering in the consumer, or if the consuming component will handle its own subscription), oruseSyncHandleto gain access to the handle in the consumer and get rerendering triggered.