useStorageBackedState

JSON →
library 2.0.5 ·javascript
verified Jun 7, 2026

Custom React hook (v2.0.5) for state management like `useState` but persisted to `localStorage`. Supports `sessionStorage`, custom serializers, and real-time synchronization across tabs via storage events. Requires React 18 or 19. Ships TypeScript types. More lightweight than alternatives like `react-storage-hooks` or `use-persisted-state`, with a focus on simple hook-based API and external get/set/subscribe utilities.