zustand-state-management

Installation
Summary

Type-safe global state management for React with persist, devtools, and Next.js SSR support.

  • Supports TypeScript with double-parentheses syntax (create<T>()()), persist middleware for localStorage, and Redux DevTools integration
  • Prevents 6 documented errors including hydration mismatches, infinite render loops, and persist race conditions (fixed in v5.0.10+)
  • Includes slices pattern for modular stores, vanilla store creation without React, and immer middleware for mutable-style updates
  • Handles Next.js SSR with _hasHydrated flag pattern and experimental unstable_ssrSafe middleware to avoid client-server state mismatches
SKILL.md

Zustand State Management

Last Updated: 2026-01-21 Latest Version: zustand@5.0.10 (released 2026-01-12) Dependencies: React 18-19, TypeScript 5+


Quick Start

npm install zustand

TypeScript Store (CRITICAL: use create<T>()() double parentheses):

import { create } from 'zustand'

interface BearStore {
Related skills
Installs
1.3K
GitHub Stars
776
First Seen
Jan 20, 2026