tanstack-query

Guide React developers through TanStack Query v5 data management and v4 migration.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps developers efficiently manage server state in React applications, simplifying data fetching, caching, and synchronization.

Core Features & Use Cases

  • Modern Data Fetching: Leverage TanStack Query v5 for robust client-side data management.
  • v5 Migration & Debugging: Fix common migration errors from v4, debug SSR/hydration issues, and implement advanced patterns like optimistic updates and infinite queries.
  • Use Case: You're migrating a React app from React Query v4 to v5 and encountering errors with object syntax or callbacks. This Skill provides the exact fixes and explanations needed.

Quick Start

Use the tanstack-query skill to understand the new object syntax for useQuery in v5.

Frequently Asked Questions about tanstack-query

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

FAQPage Schema
How do I fix useQuery syntax errors when migrating to TanStack Query v5?

TanStack Query v5 migration requires adopting the new object syntax for useQuery, passing a single arguments object instead of separate parameters to resolve syntax errors from v4.

How do I implement optimistic updates with TanStack Query in React?

Optimistic updates in TanStack Query are implemented by leveraging the new useMutationState feature, allowing you to immediately reflect changes in the UI before the server confirms the mutation.

What is the best way to handle offline support and network modes in React Query?

The best way to handle offline support in React Query is by configuring network modes, which dictate how queries and mutations behave when a network connection is unavailable or unstable.

How does throwOnError work for error handling in TanStack Query v5?

throwOnError in TanStack Query v5 works by propagating query errors to the nearest error boundary, allowing you to declaratively handle application-wide errors instead of manually checking state flags.

How do I configure infinite queries for data fetching in React?

You configure infinite queries in React by utilizing TanStack Query's infinite query hook to manage pagination, which automatically handles fetching additional pages and appending them to the existing list.

Why were callbacks removed in TanStack Query v5 and how do I adapt?

Callbacks were removed in TanStack Query v5 to simplify the API and encourage the use of effects for side effects; you adapt by moving logic to useEffect or mutation callbacks.