tanstack-query

Manage asynchronous server state with caching and data synchronization for frontend applications.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of managing server state in modern web applications, eliminating the need for manual caching, synchronization, and error handling logic.

Core Features & Use Cases

  • Automatic Caching & Synchronization: Keeps your UI in sync with server data by automatically refetching and caching responses.
  • Advanced Data Patterns: Supports complex requirements like infinite scrolling, pagination, optimistic updates, and dependent queries out of the box.
  • Use Case: Use this to manage a high-frequency dashboard where data needs to be updated in the background without interrupting the user experience, while ensuring the cache is invalidated correctly after mutations.

Quick Start

Use the tanstack-query skill to implement a new data fetching hook that caches user profile data for five minutes and automatically refetches on window focus.

Frequently Asked Questions about tanstack-query

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

FAQPage Schema
How do I manage asynchronous server state and data fetching in React?

You can manage asynchronous server state by utilizing automatic caching, background refetching, and data synchronization utilities designed to keep your frontend UI in sync with server responses.

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

Implementing infinite scrolling and optimistic UI updates relies on advanced data fetching patterns that support dependent query execution alongside robust query invalidation after mutations.

How do I cache user profile data and automatically refetch on window focus in TypeScript?

You can cache user profile data and trigger automatic refetching on window focus by configuring a custom data fetching hook with a defined stale time and background synchronization enabled.

Does TanStack Query support server-side rendering hydration and suspense integration?

Yes, server-side rendering hydration and suspense integration are supported, providing utilities to prefetch queries on the server and seamlessly synchronize state during client hydration.

Can I use this for a high-frequency dashboard requiring background data updates?

Yes, this approach fits high-frequency dashboards by automatically refetching and caching server responses in the background, ensuring data updates without interrupting the user experience.