tanstack-query

Manage React server state with TanStack Query v5 queries, mutations, and caching.

Updated Jan 29, 2026
One-click install
npx skills add https://github.com/brendadeeznuts1111/tier-1380-omega --skill tanstack-query-brendadeeznuts1111
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/brendadeeznuts1111/tier-1380-omega/tree/main/skills/tanstack-query
Command: npx skills add https://github.com/brendadeeznuts1111/tier-1380-omega --skill tanstack-query-brendadeeznuts1111

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides comprehensive guidance and best practices for managing server state in React applications using TanStack Query v5, helping you avoid common pitfalls and implement efficient data fetching and caching strategies.

Core Features & Use Cases

  • Setup & Configuration: Guides you through setting up QueryClient and QueryClientProvider.
  • Queries & Mutations: Demonstrates correct usage of useQuery, useMutation, and new v5 features like useMutationState.
  • v4 to v5 Migration: Addresses all breaking changes, including object syntax, callback removal, and status renames.
  • Advanced Patterns: Covers optimistic updates, infinite scrolling, prefetching, and error handling with throwOnError.
  • Use Case: You're migrating a React app from React Query v4 to v5, or you're starting a new project and need to implement robust data fetching. This Skill ensures you use the latest v5 patterns correctly, preventing common errors and improving performance.

Quick Start

Use the tanstack-query skill to set up a basic data fetching flow in your React 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 without breaking my app?

TanStack Query v5 manages React server state by handling data fetching, mutations, and caching. It replaces manual state tracking by providing built-in query invalidation, background updates, and optimized caching strategies through QueryClient configuration.

How do I set up data fetching in a React app using TanStack Query v5?

Use useMutationState to track mutation states across your React components, monitor pending requests, and capture mutation errors. It provides a centralized view of mutation statuses without needing manual state lifting or complex context implementations.

What is the best way to handle errors and network connectivity with TanStack Query v5?

Implement infinite scrolling in TanStack Query v5 using infiniteQueryOptions. This requires defining the initialPageParam requirement and managing page parameters to fetch data incrementally, ensuring smooth pagination without hitting object syntax errors.

Why are my TanStack Query v5 callbacks and status properties causing TypeScript errors?

Implement optimistic updates in TanStack Query v5 using useMutation. Apply mutation changes immediately to the cache before server confirmation, then automatically rollback if the mutation fails, providing a responsive UI without manual cache manipulation.