tanstack-query

Optimize TanStack Query v5 data fetching, caching, and mutation patterns in React applications.

193|17|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/pproenca/dot-skills --skill tanstack-query-pproenca
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/pproenca/dot-skills/tree/main/skills/.curated/tanstack-query
Command: npx skills add https://github.com/pproenca/dot-skills --skill tanstack-query-pproenca

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses common performance pitfalls in TanStack Query v5, such as request waterfalls, inefficient caching, and suboptimal rendering, ensuring faster and more responsive data fetching in React applications.

Core Features & Use Cases

  • Performance Optimization: Provides 40+ rules across 8 categories to fine-tune query keys, caching, mutations, and rendering.
  • Waterfall Prevention: Guides developers to avoid sequential data requests, significantly reducing load times.
  • Use Case: When building a dashboard with multiple data-heavy components, apply the principles from this Skill to ensure all data loads in parallel, providing an instant-feeling user experience.

Quick Start

Apply the TanStack Query v5 best practices to optimize the data fetching logic in the current project.

Frequently Asked Questions about tanstack-query

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

FAQPage Schema
How do I fix request waterfalls in React TanStack Query?

To fix request waterfalls in TanStack Query, you must identify sequential data requests and restructure them to load in parallel. This optimization prevents cascading fetches, significantly reducing load times and improving application responsiveness.

What is the best way to structure query keys for cache invalidation in TanStack Query v5?

The best way to structure query keys in TanStack Query v5 is to use a hierarchical array format. This structure enables precise cache invalidation strategies, allowing you to target specific queries or broad query groups during data mutations.

How do I optimize rendering performance when fetching data-heavy components in React?

To optimize rendering performance when fetching data-heavy components, apply TanStack Query best practices for parallel data loading and render optimizations. This approach ensures an instant-feeling user experience without unnecessary component re-renders.

Does TanStack Query v5 work with Suspense for data fetching optimization?

Yes, TanStack Query v5 supports Suspense integration for data fetching. Enforcing best practices for this integration allows you to handle loading states declaratively while maintaining application responsiveness and strict error handling boundaries.

Why does my TanStack Query cache invalidation strategy cause performance bottlenecks?

Cache invalidation strategies cause performance bottlenecks when query keys are poorly structured or invalidation is too broad. Optimizing your query key structure and applying targeted invalidation rules resolves these suboptimal rendering and fetching delays.