tanstack-query

Manage server state fetching and synchronization in React with TanStack Query v5.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/j19800824/miliguan --skill tanstack-query-j19800824
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/j19800824/miliguan/tree/main/apps/admin/.agents/skills/tanstack-query
Command: npx skills add https://github.com/j19800824/miliguan --skill tanstack-query-j19800824

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers manage complex server state, data fetching, caching, and synchronization challenges in React applications using TanStack Query v5 patterns.

Core Features & Use Cases

  • Data Fetching Patterns: Provides guidance for useSuspenseQuery, useQuery, query keys, and API service integration.
  • Mutation Management: Covers create, update, delete workflows with cache invalidation and optimistic updates.
  • Cache Optimization: Supports prefetching, persistence, retries, and advanced cache management strategies for production applications.

Quick Start

Use the tanstack-query skill to implement a React data fetching flow with useSuspenseQuery, mutations, and cache invalidation.

Frequently Asked Questions about tanstack-query

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

FAQPage Schema
How do I manage server state and data fetching in React?

You can manage server state in React by using TanStack Query v5 patterns for data fetching, query hooks, and cache synchronization. It provides conventions for configuring queries and handling API integration scenarios.

How do I handle cache invalidation after a mutation in React Query?

Cache invalidation after a mutation in React Query is handled through mutation workflows that support create, update, and delete operations. You configure cache updates and optimistic updates to synchronize server state changes.

Does TanStack Query v5 support Suspense integration for data retrieval?

Yes, TanStack Query v5 supports Suspense integration for data retrieval in React applications. You can use the useSuspenseQuery hook to implement data fetching flows that align with React's concurrent rendering features.

What's the best way to optimize cache management for production React applications?

The best way to optimize cache management is by applying advanced strategies like prefetching, persistence, and retries. These TanStack Query patterns ensure reliable server state synchronization and efficient data fetching in production.

How do I structure query keys for API service integration?

Structuring query keys for API service integration involves applying TanStack Query v5 conventions for query configuration. Proper query keys enable efficient cache management and data synchronization across your React application workflows.