tanstack-query

Document and research TanStack Query for data fetching and caching.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive documentation and guidance for TanStack Query (formerly React Query), simplifying complex asynchronous state management in applications.

Core Features & Use Cases

  • Data Fetching & Caching: Efficiently manage server state, including fetching, caching, synchronizing, and updating data.
  • Advanced Patterns: Supports mutations, optimistic updates, query invalidation, infinite scrolling, SSR, and more.
  • Use Case: When building a dashboard that displays real-time user data, this Skill can help you implement robust data fetching and caching strategies to ensure a smooth and responsive user experience.

Quick Start

Research TanStack Query documentation to implement basic data fetching with useQuery.

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 caching in React?

TanStack Query manages server state by providing built-in mechanisms for data fetching, caching, and synchronization across your application. It automatically handles background updates and stale data to maintain a responsive user experience.

What is the best way to implement optimistic updates and mutations?

The best way to implement optimistic updates and mutations is by using TanStack Query's built-in mutation patterns. It supports applying optimistic UI changes immediately and rolling them back automatically if the server mutation fails.

Does TanStack Query work with server-side rendering (SSR)?

Yes, TanStack Query fully supports server-side rendering (SSR) to manage asynchronous state during the initial server load. It provides advanced SSR patterns to ensure proper data fetching, hydration, and synchronization when rendering applications on the server.

How do I handle query invalidation after data mutations?

Handle query invalidation after data mutations by leveraging TanStack Query's synchronization patterns to automatically refetch and update server state. Query invalidation marks specific cached data as stale, ensuring subsequent component reads trigger a fresh data fetch from the server.

Can I implement infinite scrolling for paginated data fetching?

Yes, you can implement infinite scrolling for paginated data fetching using TanStack Query's dedicated infinite queries feature. It manages asynchronous state by automatically caching and appending newly fetched pages of server data as the user scrolls down.