A lightweight React state manager for local storage with real-time cross-tab sync. current version 1.2.2, released periodically. Key differentiators: no external dependencies, simple hook-based API (get/set/reset/hasValue), automatic persistence and synchronization across tabs. Eliminates need for Redux, Context API, or Zustand for persistent state. ESM-only, requires React 19.
npm install create-lsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage of createLS hook: initializing, getting, setting, resetting a persistent counter.
Ensure the component is a client component ("use client") and avoid calling createLS in non-React contexts.Use dynamic import or conditional rendering to avoid SSR issues, or wrap with 'use client'.
Update to v1.2.0+ and use hasValue as a boolean property (no parentheses) if you were calling it as hasValue().
Use ESM import syntax (import { createLS } from 'create-ls') or upgrade to a bundler that supports ESM.Always pass a string as the first argument to createLS.
Change import createLS from 'create-ls' to import { createLS } from 'create-ls'Ensure createLS is called within a React component (client-side) and after the component mounts.
Run `npm install create-ls` and verify the import path is correct: 'create-ls'