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 |