tanstack-query

Manage server state in React applications with TanStack Query v5.

3|Updated Nov 14, 2025
One-click install
npx skills add https://github.com/evolv3ai/claude-skills-archive --skill tanstack-query-evolv3ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/evolv3ai/claude-skills-archive/tree/main/skills/tanstack-query
Command: npx skills add https://github.com/evolv3ai/claude-skills-archive --skill tanstack-query-evolv3ai

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the complex process of managing server state in React applications, preventing common errors and accelerating development for TanStack Query (formerly React Query) v5.

Core Features & Use Cases

  • Setup & Configuration: Provides best-practice setup for QueryClient, providers, and DevTools.
  • Query & Mutation Hooks: Demonstrates correct usage of useQuery, useMutation, useInfiniteQuery, and useMutationState.
  • v4 to v5 Migration: Guides users through all breaking changes, including object syntax, callback removal, and status renaming.
  • Advanced Patterns: Covers optimistic updates, prefetching, error handling with throwOnError, and offline support.
  • Use Case: You're migrating a React app from React Query v4 to v5. This Skill provides the exact code patterns and explanations to fix all breaking changes, ensuring a smooth transition and preventing runtime errors.

Quick Start

Use the tanstack-query skill to set up a basic React Query v5 client and provider in your application.

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

TanStack Query v5 migration requires updating to object syntax for hooks, removing callbacks, and renaming status properties. This Skill guides you through all breaking changes with exact code patterns to ensure a smooth transition and prevent runtime errors.

How do I set up QueryClient and providers for React server state?

Setting up React server state involves configuring the QueryClient, wrapping your application with providers, and enabling DevTools. This Skill provides best-practice setup patterns for TanStack Query v5 to manage data fetching and caching effectively.

What is the best way to handle optimistic updates with useMutation in React?

Optimistic updates with useMutation in React allow you to immediately reflect changes in the UI before server confirmation. This Skill demonstrates advanced patterns for implementing optimistic updates alongside robust error handling and offline support.

Does TanStack Query v5 require React 18 and TypeScript?

TanStack Query v5 requires React 18+ and TypeScript 4.7+ for optimal type safety and features. This environment setup ensures you can fully leverage the server state management capabilities and hook usage covered by the Skill.

Why are my useQuery callbacks not working after updating TanStack Query?

TanStack Query v5 removed callbacks from useQuery and other hooks, replacing them with object syntax. This Skill covers all breaking changes from the v4 to v5 migration, helping you fix callback removals and status renaming issues.

Can I use TanStack Query for offline data fetching and error handling?

TanStack Query supports offline capabilities and error handling using throwOnError. This Skill details how to implement these advanced patterns, ensuring your React application maintains data fetching integrity even without a stable network connection.