useReadLocalStorage
Read-only localStorage subscriptions shared with useLocalStorage.
Reads through the same store as useLocalStorage, including same-tab notifications, native cross-tab storage events and blocked-storage fallback. It never exposes write actions.
Usage
Examples
Playground
API
4 options
1 return value
Accessibility
Announce meaningful changes in context. Do not put sensitive data in browser storage.
Notes
- Same-tab changes made with useLocalStorage notify readers. Direct localStorage.setItem calls in the same tab do not dispatch a storage event.
Related
useLocalStorageuseState persisted to localStorage, synced across components and tabs.useMapMap state with immutable set, replace, remove, clear and reset actions.useSelectionMulti-select state in a Set, with select-all and indeterminate support.useSessionStorageuseState persisted to sessionStorage for one tab.