state-management

Outline React state management best practices for Context, Redux, Zustand, and Recoil.

40|9|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/akillness/oh-my-skills --skill state-management-akillness
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: state-management
Source: https://github.com/akillness/oh-my-skills/tree/main/.agent-skills/state-management
Command: npx skills add https://github.com/akillness/oh-my-skills --skill state-management-akillness

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manage global and cross-component state in frontend apps, enabling predictable data flow and easier maintenance.

Core Features & Use Cases

  • React Context for lightweight global state (themes, language).
  • Redux, Zustand, and Recoil support for larger apps with middleware and advanced patterns.
  • Clear guidance on local vs global state, asynchronous data handling, and state synchronization across components.
  • Use cases: theme toggling, user authentication, caching UI preferences, and routing state.

Quick Start

Create a minimal React example that demonstrates a Theme toggle using Context for global state and a sample component consuming it.

Frequently Asked Questions about state-management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to manage global state in React for theming and authentication?

React Context provides a lightweight global state solution for theming and authentication, ensuring predictable data flow without heavy boilerplate. It enables clear separation of concerns and easier maintenance across components.

How do I choose between Redux, Zustand, and Recoil for state management?

Redux, Zustand, and Recoil offer different approaches for larger applications requiring middleware and advanced patterns. Redux provides strict predictability, Zustand offers a lightweight footprint, and Recoil handles asynchronous data synchronization across components.

How do I handle asynchronous data and state synchronization in React?

Handle asynchronous data and state synchronization in React by applying patterns for Redux, Zustand, or Recoil. These libraries support middleware to manage async flows, ensuring type safety and immutability across common scenarios.

Do I need TypeScript for frontend state management?

TypeScript is not strictly required but is highly recommended for frontend state management to ensure type safety. Applying TypeScript patterns guarantees immutability and clear separation of concerns across your state logic.

When should I use local vs global state in a React application?

Use local state for UI-specific data confined to a single component, and global state for cross-component data like themes or user authentication. Distinguishing local vs global state ensures predictable data flow and easier maintenance.