managing-state

Installation
SKILL.md

Managing State in React/TypeScript Applications

Decision Table: When to Use Each Pattern

Pattern Use Cases Examples
Global Zustand Stores Business logic, CRUD, domain state useProductStore, useAuthStore
Atomic Zustand Stores Component UI state, local behavior useProductCardStore, modal state
React Context Framework integration, component tree ThemeProvider, EditionProvider
URL State (nuqs) Shareable/bookmarkable state Pagination, filters, search
Form State (RHF + Zod) Complex forms with validation Auth forms, data entry
React useState Simple local UI state (1-2 values) Toggle, open/close

Quick Decision Guide

  • Need to share across components? -> Zustand
  • Need URL persistence? -> nuqs
  • Form with validation? -> React Hook Form + Zod
  • Framework/library integration? -> Context
Related skills
Installs
2
First Seen
Mar 22, 2026