tanstack-query

Manage server state in React apps with TanStack Query v5.

Updated Feb 2, 2026
One-click install
npx skills add https://github.com/pelith/Project-Remora-Frontend --skill tanstack-query-pelith
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/pelith/Project-Remora-Frontend/tree/main/.agents/skills/tanstack-query
Command: npx skills add https://github.com/pelith/Project-Remora-Frontend --skill tanstack-query-pelith

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Manage server state in React applications using TanStack Query v5 to unify data fetching and caching across UIs.

Core Features & Use Cases

  • Cross-component mutation tracking with useMutationState to monitor pending mutations.
  • Network mode options (online/offline) and infiniteQueryOptions to simplify complex query patterns.
  • Migration guidance for v4→v5 changes (object syntax, gcTime, isPending) and SSR hydration debugging.

Quick Start

Install dependencies, initialize a QueryClient, wrap your app with QueryClientProvider, and use hooks like useQuery with the object-style options.

Frequently Asked Questions about tanstack-query

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

FAQPage Schema
How do I migrate React data fetching from TanStack Query v4 to v5?

To migrate React data fetching from v4 to v5, adopt the enforced object syntax for hooks, replace cacheTime with gcTime, and update to the initial pending state semantics. Type-safe error handling for queries and mutations is also required.

How does cross-component mutation tracking work in TanStack Query?

Cross-component mutation tracking uses the useMutationState hook to monitor pending mutations across your React application. This allows you to observe mutation states globally without manually passing props between components.

Does TanStack Query v5 support SSR hydration and offline network modes?

Yes, TanStack Query v5 supports SSR hydration debugging and network mode options for online or offline environments. These features ensure reliable server state management and data fetching consistency across varying network conditions.

What is the best way to manage infinite queries in React applications?

The best way to manage infinite queries is using the infiniteQueryOptions helper to simplify complex query patterns. This approach standardizes pagination logic and integrates seamlessly with TanStack Query's unified server state caching.

Why did my React query cache behavior change after upgrading to v5?

Your React query cache behavior changed because v5 enforces gcTime-based cache management, replacing the previous cacheTime property. This update alters garbage collection timing and requires object-style syntax for all hook configurations.