useBroadcastState
State that stays in sync across every open tab of your site. Uses BroadcastChannel and falls back to the storage event.
- Level
- Advanced
- Since
- v2.1.0
import {useBroadcastState} from '@zenuilabs/react-hooks';Loading demo_
More in State
StateBasicuseCounterHold a number with stable increment, decrement, set and reset helpers. Optional min, max and step options keep it inside a range, which suits quantity pickers and pagers.StateIntermediateuseLocalStorageKeep a piece of state in localStorage as JSON, synced across components and browser tabs. Use it for preferences and drafts that should survive a reload.StateIntermediateuseMapA Map in React state with immutable updates and stable action functions. Use it for keyed collections such as carts, caches and lookups by id.