#state
4 snippets tagged with #state
typescriptintermediate
useLocalStorage — Persistent State Hook
Sync React state with localStorage including SSR safety, JSON serialization, and cross-tab updates.
#hooks#localstorage
typescriptadvanced
Optimistic Update Pattern
Apply UI changes immediately before server confirmation with automatic rollback on failure.
#optimistic-update#state
typescriptbeginner
usePrevious Hook
Track the previous value of any state or prop using a ref-based hook for comparison logic.
#hooks#state
typescriptintermediate
useFormValidation Hook
Lightweight form validation hook with field-level errors, touched tracking, and submit handling.
#hooks#forms