tanstack-query

Manage React server state with TanStack Query v5 hooks and caching.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (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, and resolving common migration issues from v4 to v5.

Core Features & Use Cases

  • Data Fetching & Caching: Streamlines fetching, caching, and updating server data.
  • Migration Assistance: Provides guidance and fixes for v4 to v5 upgrades, including syntax changes and deprecated options.
  • Advanced Patterns: Covers optimistic updates, infinite queries, and error handling strategies.
  • Use Case: When building a dashboard that displays frequently changing data, this Skill ensures the UI stays up-to-date efficiently without manual cache invalidation or complex state logic.

Quick Start

Use the tanstack-query skill to set up the QueryClientProvider with ReactQueryDevtools in your main application file.

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 in React without manual cache invalidation?

To manage server state in React, you can use TanStack Query v5 to handle data fetching, caching, and synchronization automatically. This ensures your UI stays up-to-date efficiently without complex state logic.

What is the best way to fix TanStack Query v4 to v5 migration errors?

To fix TanStack Query v4 to v5 migration errors, address deprecated options and syntax changes. This includes migrating to updated hooks like useMutationState and infiniteQueryOptions according to v5 best practices.

How do I implement optimistic updates and infinite queries in React?

Implement optimistic updates and infinite queries in React using TanStack Query v5 advanced patterns. The framework provides specific options like infiniteQueryOptions to handle complex data fetching and error handling strategies.

Why does my React application have SSR and hydration issues with streaming server components?

SSR and hydration issues with streaming server components occur due to improper server state synchronization. Using TanStack Query v5 resolves these hydration mismatches by managing server state fetching correctly during streaming.

Can I use TanStack Query for network mode handling and error boundaries in TypeScript?

Yes, you can use TanStack Query in TypeScript applications to manage network modes and error handling. It provides specific options like throwOnError to integrate with error boundaries effectively.

How do I set up the QueryClientProvider and ReactQueryDevtools in my main application file?

Set up the QueryClientProvider and integrate ReactQueryDevtools in your main application file to initialize TanStack Query. This configuration establishes the core context required for managing server state across your React component tree.