react-state-management

Orchestrate React state with useState, TanStack Query, Zustand, and URL parameters.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/dungle-scrubs/agent-config --skill react-state-management-dungle-scrubs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-state-management
Source: https://github.com/dungle-scrubs/agent-config/tree/main/stow/shared/skills/react-state-management
Command: npx skills add https://github.com/dungle-scrubs/agent-config --skill react-state-management-dungle-scrubs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers coordinate React state across local component state, server state via TanStack Query, and global state with Zustand, while enabling shareable URL-based state to reduce prop drilling and keep UI predictable.

Core Features & Use Cases

  • TanStack Query: server state handling with caching and background updates.
  • Zustand: lightweight global state for TS-friendly apps.
  • URL Parameters: make state shareable and bookmarkable via URL.
  • Custom Events: cross-framework communication for non-React code.
  • Use Case: manage a dashboard filter where local UI state combines with server data and URL state.

Quick Start

  • Set up a new feature by modeling local state, server data fetch using TanStack Query, and URL state for shareable filters. Example: "Implement a product list that uses local search input, data fetched with TanStack Query, and a URL-exposed category filter."

Frequently Asked Questions about react-state-management

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

FAQPage Schema
How do I choose between useState, Context API, Zustand, and TanStack Query for React state management?

React state management selection depends on scope: useState for local UI, Context API for simple shared state, Zustand for lightweight global state, and TanStack Query for server state with caching. This strategy coordinates state across these layers to reduce prop drilling.

What is the best way to manage server state and caching in React applications?

Server state management in React is best handled via TanStack Query, which orchestrates data fetching, caching, and background updates. This approach isolates server data from local component state to keep UI predictable and synchronized.

How do I make React component state shareable and bookmarkable through URL parameters?

URL parameters make React component state shareable by exposing filters and view configurations in the browser address bar. This URL state pattern ensures state is bookmarkable and reduces prop drilling by allowing direct state sharing.

Can I use Zustand for global state while fetching data with TanStack Query in the same React feature?

Zustand and TanStack Query can be used together to separate lightweight global client state from server state. This combination allows local UI state to combine with fetched server data and URL state for cohesive dashboard filtering.

How do I handle cross-framework communication with non-React code when coordinating state?

Cross-framework communication for non-React code is handled using custom events. This allows external scripts to interact with React state boundaries without tightly coupling to the component tree or Zustand store.