v6.3.0
What's Changed
Refactor
- createStorage: Replace
useState+useDeepCompareEffectwithuseSyncExternalStore, eliminating CSR first-render flicker, SSR hydration mismatches, and stale cross-tab reads (#195)
Bug Fixes
- createStorage: Fix stale closure in consecutive functional updates within the same synchronous batch —
updateStatenow reads fromgetSnapshot()instead of the render-timestate
Tests
- useLocalStorage: Add 12 new test cases covering cross-tab sync,
storage.clear(),listenToStorageChangestoggle, three-state semantics,onError,mountStorageValue, and consecutive functional updates
Full Changelog: v6.1.12...v6.3.0