tanstack-query

Guide TanStack Query v5 data fetching, caching, and mutations in React.

1|Updated Sep 26, 2025
One-click install
npx skills add https://github.com/pascallammers/mylo-travel-concierge-v2 --skill tanstack-query-pascallammers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/pascallammers/mylo-travel-concierge-v2/tree/main/.factory/skills/tanstack-query
Command: npx skills add https://github.com/pascallammers/mylo-travel-concierge-v2 --skill tanstack-query-pascallammers

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexities of data fetching, caching, and state management in React applications, ensuring efficient and reliable data handling.

Core Features & Use Cases

  • Efficient Data Fetching: Streamlines fetching, caching, and synchronizing server state.
  • Optimistic Updates & Mutations: Manages data mutations with immediate UI feedback and robust error handling.
  • Advanced Caching: Implements sophisticated caching strategies for optimal performance and user experience.
  • Use Case: When building a dashboard that displays real-time user data, this Skill helps manage the fetching and updating of that data efficiently, preventing stale information and providing a smooth user experience.

Quick Start

Use the tanstack-query skill to implement a basic useQuery hook for fetching user data.

Frequently Asked Questions about tanstack-query

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

FAQPage Schema
How do I fetch and cache server state in React applications?

To manage React data fetching and caching, utilize TanStack Query to streamline server state synchronization and prevent stale information. It provides expert guidance on implementing query hooks with sophisticated caching strategies for optimal UI performance.

How do I implement optimistic updates and mutations for immediate UI feedback?

Implement optimistic updates and mutations in React using TanStack Query to manage data mutations with immediate UI feedback and robust error handling. This ensures smooth user experiences when synchronizing real-time server state changes.

What is the best way to handle cache invalidation and pagination in React?

The best way to handle cache invalidation and pagination in React is by leveraging TanStack Query's advanced caching strategies. It supports infinite queries and cache invalidation to maintain optimal performance and reliable server state synchronization.

Does TanStack Query v5 support infinite queries for real-time dashboards?

Yes, TanStack Query v5 supports infinite queries and advanced caching strategies specifically designed for building real-time dashboards. It manages fetching and updating user data efficiently, preventing stale information while optimizing UI performance.

When do I need a dedicated state management library for server state in React?

You need a dedicated server state management library in React when building applications requiring efficient server state synchronization and optimized UI performance. TanStack Query addresses complexities of data fetching, caching, and mutations to prevent stale information.