tanstack-query

Manage React server-state with TanStack Query v5 data fetching and caching.

1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/iAmAdheil/DSP_TARA --skill tanstack-query-iamadheil
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/iAmAdheil/DSP_TARA/tree/main/.claude/skills/tanstack-query
Command: npx skills add https://github.com/iAmAdheil/DSP_TARA --skill tanstack-query-iamadheil

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TanStack Query v5 patterns address complex server-state management in React apps by coordinating data fetching, caching, and synchronization across client and server boundaries.

Core Features & Use Cases

  • Breaking changes migration and first-class Suspense support
  • Mutations with optimistic updates, invalidation, and error handling
  • SSR/CSR configuration for Next.js, Remix, and app routers
  • Type-safe query options, key factories, and custom hooks pattern for feature-based co-location
  • Testing with MSW and debugging utilities

Quick Start

Install TanStack Query v5, initialize a QueryClient, and begin using useQuery and useMutation for server-state management.

Frequently Asked Questions about tanstack-query

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

FAQPage Schema
How do I manage server-state and data fetching in React applications?

Server-state management in React applications is handled by providing a unified data-fetching and caching pattern using TanStack Query v5, coordinating synchronization across client and server boundaries.

How do I set up SSR and Suspense with TanStack Query v5?

SSR and Suspense setup with TanStack Query v5 involves configuring CSR for Next.js or Remix app routers, utilizing first-class Suspense support to handle asynchronous rendering boundaries.

What is the best way to handle mutations and optimistic updates in React Query?

Handling mutations and optimistic updates in React Query requires applying invalidation and error handling patterns, ensuring data synchronization when reverting from failed server requests.

How do I create type-safe query options and custom hooks in TanStack Query?

Type-safe query options and custom hooks in TanStack Query are created by implementing key factories and feature-based co-location patterns, ensuring strict TypeScript inference for query definitions.

Can I test TanStack Query data fetching with MSW?

You can test TanStack Query data fetching with MSW by utilizing debugging utilities to mock server responses, validating mutation logic and query caching behavior across application boundaries.

Does this Skill cover breaking changes migration for TanStack Query v5?

Breaking changes migration for TanStack Query v5 is covered by providing guidance on transitioning from previous versions, adopting new first-class Suspense support, and updating server-state patterns.