tanstack-query

Fetch and cache server data in React with TanStack Query v5.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @tanstack/react-query, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps developers efficiently manage server state in React applications using TanStack Query v5. It streamlines data fetching, state management, and error handling, simplifying the development of complex applications.

Core Features & Use Cases

  • Data Fetching and Caching: Fetch and cache data from servers, with support for caching strategies and stale time control.
  • State Management: Maintain state across components without prop drilling, simplifying complex state logic.
  • Error Handling: Provides robust error handling and boundary components to manage and display errors gracefully.
  • Use Case: Use this Skill to manage user data, product listings, and inventory data in a React application, ensuring efficient and reliable state management.

Quick Start

Use the tanstack-query skill to fetch user data from the server.

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 without prop drilling?

TanStack Query v5 manages server state by handling data fetching, caching, and error handling globally. This prevents prop drilling and reduces state logic complexity across your React components.

What is the best way to cache API data and control stale time in a React application?

TanStack Query provides built-in data caching strategies with configurable stale time control. This optimizes performance by automatically managing server state and reducing unnecessary network requests.

Does TanStack Query v5 require TypeScript and support SSR hydration?

TanStack Query v5 requires React and TypeScript, and includes explicit support for SSR and hydration. It also provides additional functionality for building Progressive Web Apps.

How do I handle API fetching errors gracefully in React components?

TanStack Query provides robust error handling and error boundary components to manage API fetching failures. This allows you to display errors gracefully and maintain reliable data fetching.

TanStack Query vs other state management libraries for React: when should I use it?

Use TanStack Query specifically for managing server state rather than client state. It streamlines fetching, caching, and synchronizing data from servers, simplifying complex application development compared to generic state managers.