tanstack-query

Manage React server state with TanStack Query v5 hooks.

417|7|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/Asymmetric-al/core --skill tanstack-query-asymmetric-al
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/Asymmetric-al/core/tree/main/.cursor/skills/tanstack-query
Command: npx skills add https://github.com/Asymmetric-al/core --skill tanstack-query-asymmetric-al

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you 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

  • Server State Management: Use hooks like useQuery and useMutation for robust data handling.
  • v4 to v5 Migration: Addresses breaking changes like object syntax, gcTime, isPending, and placeholderData.
  • Advanced Patterns: Implements optimistic updates, infinite scrolling, prefetching, and error handling with throwOnError.
  • Use Case: Integrate TanStack Query into your React app to fetch user data, manage form submissions with instant UI feedback, and ensure data consistency across your application, all while leveraging the latest v5 features.

Quick Start

Use the tanstack-query skill to set up the QueryClientProvider and 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 with TanStack Query?

Server state in React is managed using TanStack Query v5 hooks like useQuery and useMutation for data fetching, caching, and synchronization. This approach simplifies ensuring data consistency across your application without manual state tracking.

How do I migrate TanStack Query from v4 to v5?

Migrating TanStack Query from v4 to v5 involves addressing breaking changes like shifting to object syntax for hooks, updating cacheTime to gcTime, replacing isLoading with isPending, and adjusting placeholderData configurations.

Does TanStack Query v5 work with React 18 and TypeScript?

Yes, TanStack Query v5 requires integration with React 18+ and TypeScript to manage server state. This setup provides robust type safety and data fetching capabilities for modern React applications.

What is the best way to implement optimistic updates and infinite scrolling in React?

The best way to implement optimistic updates and infinite scrolling in React is using TanStack Query v5 advanced patterns. It provides built-in mechanisms for instant UI feedback during mutations and managing paginated data fetching efficiently.

How does TanStack Query handle error handling and offline network modes?

TanStack Query v5 handles error boundaries using the throwOnError option and supports offline network modes. This ensures your React application gracefully manages failed requests and maintains functionality without a continuous network connection.