tanstack-query

Migrate React server-state management from TanStack Query v4 to v5.

2|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/AmbitionsXXXV/Etyon --skill tanstack-query-ambitionsxxxv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/AmbitionsXXXV/Etyon/tree/main/.agents/skills/tanstack-query
Command: npx skills add https://github.com/AmbitionsXXXV/Etyon --skill tanstack-query-ambitionsxxxv

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

TanStack Query v5 streamlines server state management in React apps, handling data fetching, caching, and mutations, while guiding migration from v4 to v5.

Core Features & Use Cases

  • Data fetching, caching, mutations, and query invalidation patterns for reliable server state
  • Migration guidance for v4 to v5, advanced patterns like suspense, SSR, prefetching, and DevTools integration
  • Comprehensive templates, references, and examples to accelerate production-ready setups

Quick Start

Install and configure a QueryClient, wrap your app with QueryClientProvider, and start using useQuery and useMutation with object syntax.

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 Query from v4 to v5?

Migrating React Query from v4 to v5 requires switching to object syntax for hooks, replacing cacheTime with gcTime, and adopting queryOptions factories. This Skill provides migration guidance and templates to update your server-state management patterns.

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

Server-state in React is managed by handling data fetching, caching, and mutations through dedicated hooks. This Skill implements robust server-state patterns using TanStack Query v5 to ensure reliable data synchronization and proper query invalidation.

How do I configure useQuery and useMutation with object syntax in TanStack Query?

Configuring useQuery and useMutation with object syntax involves passing arguments as a single object rather than separate parameters. This Skill enforces the v5 object syntax standard for setting up data fetching and mutations in your React components.

Does TanStack Query work with React Native and SSR setups?

TanStack Query works with React Native and SSR setups to handle server-state across web and mobile projects. This Skill documents proper suspense usage, SSR prefetch workflows, and DevTools integration for these environments.

Why did my cacheTime configuration break after upgrading to TanStack Query v5?

Your cacheTime configuration broke because v5 renamed it to gcTime for managing garbage collection. This Skill guides you through the v4 to v5 migration process, ensuring your caching invalidation and error handling patterns are updated correctly.