$npx skillfedfor your agent

Tanstack Query

TanStack Query is an async state manager that handles server data fetching, caching, and synchronization in React applications. It automates cache invalidation, deduplication, background updates, and stale data management—you supply a queryFn that returns a Promise, and the library handles the rest. Use it for infinite scrolling, offline-first apps, complex cache strategies, and hybrid server/client architectures.

TanStack Query manages server state and data fetching in React with automatic caching, deduplication, and background updates.

AI-generated summary based on this skill's SKILL.md

13 5 unlicensed, metadata onlyupdated by oakoss

Decision gist · record as of 2026-03-02

TanStack Query manages server state and data fetching in React with automatic caching, deduplication, and background updates. TanStack Query is an async state manager that handles server data fetching, caching, and synchronization in React applications. It automates cache invalidation, deduplication, background updates, and stale data management—you supply a queryFn that returns a Promise, and the library handles the rest. Use it for infinite scrolling, offline-first apps, complex cache strategies, and hybrid server/client architectures.

manual: git clone https://github.com/oakoss/agent-skills → cp -r agent-skills ~/.claude/skills/tanstack-query

Use it when

  • Tanstack Query fetches and caches server data efficiently by storing responses in memory and reusing them across components.
  • Tanstack Query specializes in server state management and can replace Redux for handling API data, async queries.
Same gist for agents: .md · .json

Install

oakoss/agent-skills/tanstack-query · repository language: Python

generated, unverified - the skill's exact subdirectory could not be determined; check the repository on GitHub

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is Tanstack Query and how does it work?

Tanstack Query is an async state manager that handles server data fetching, caching, and synchronization in React applications. You supply a queryFn that returns a Promise, and the library handles cache invalidation, deduplication, background updates, and stale data management automatically. It's designed for infinite scrolling, offline-first apps, complex cache strategies, and hybrid server/client architectures.

How does Tanstack Query handle data fetching and caching?

Tanstack Query fetches and caches server data efficiently by storing responses in memory and reusing them across components. It automatically deduplicates simultaneous API requests, reducing network calls. The library manages cache lifecycle through stale-while-revalidate patterns, background synchronization, and configurable invalidation strategies—you control when and how cached data refreshes.

Can Tanstack Query replace Redux for server-side state?

Tanstack Query specializes in server state management and can replace Redux for handling API data, async queries, and server synchronization. However, Redux remains better for client-only state. Many teams use Tanstack Query for server concerns and Redux (or Zustand) for UI state, creating a cleaner separation of responsibilities.

How do you manage async queries and server state synchronization?

Tanstack Query manages async queries through hooks like useQuery and useMutation, which handle loading, error, and success states automatically. Server state synchronization happens via background refetching, query invalidation on mutations, and stale-time configuration. The library tracks query dependencies and automatically re-fetches when data becomes stale or when you explicitly invalidate it.

What are the best practices for using Tanstack Query?

Best practices include: configure appropriate staleTime and cacheTime values for your data, use query keys consistently for invalidation, leverage background updates for non-critical data, invalidate queries after mutations, enable offline support with persistQueryClient, and use devtools to monitor cache state. Tanstack Query handles most complexity automatically—focus on defining queryFn and invalidation strategy.

How does Tanstack Query handle background data updates?

Tanstack Query handles background data updates through automatic refetching when windows regain focus, configurable stale intervals, and manual invalidation triggers. It supports background synchronization without blocking UI, polling for real-time data, and offline queue management. You control update frequency via staleTime, refetchInterval, and refetchOnWindowFocus options.

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Fetch and cache server data efficiently in React applications”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

tanstack-query
by secondsky · secondsky/claude-skills

TanStack Query v5 handles server state management in React through data fetching, caching, and mutation patterns. Learn QueryClient setup, hook usage with the v5 object syntax, and common migration issues from v4.

MITupdated Jul 2026
★ 196repo stars
React Error Handling
by oakoss · oakoss/agent-skills

Learn to implement error boundaries in React using class components or the react-error-boundary library to catch rendering errors and display fallback UIs. This skill covers when to use boundaries, reset mechanisms, error logging, and common pitfalls to avoid.

no license declared → metadata onlyupdated Mar 2026
★ 13repo stars
tanstack-query
by tanstack-skills · tanstack-skills/tanstack-skills

TanStack Query provides asynchronous state management for server data across React, Vue, Solid, Svelte, and Angular. It handles caching, background synchronization, pagination, infinite scrolling, and optimistic updates automatically. Use queries for data fetching and mutations for server modifications, with lifecycle hooks for managing side effects and rollback scenarios.

MITupdated Jan 2026
★ 30repo stars
tanstack-query
by pproenca · pproenca/dot-skills

TanStack Query Best Practices provides 40 prioritized rules across 8 categories to optimize data fetching, caching strategies, and query patterns in v5 applications. Covers query key structure, cache configuration, mutation handling, prefetching, infinite queries, Suspense integration, error handling, and render optimization.

MITupdated Jul 2026
★ 182repo stars
react-query-best-practices
by arraydude · arraydude/agent-skills

A comprehensive guide to React Query v4 organized around 24 rules spanning query keys, mutations, caching strategy, WebSocket integration, TypeScript patterns, testing, and common pitfalls. Each rule includes explanations and code examples to help you implement async state management correctly and avoid frequent mistakes.

MITupdated Jul 2026
★ 1repo stars
Tanstack Devtools
by oakoss · oakoss/agent-skills

TanStack DevTools provides debugging panels for inspecting Query cache, Router route trees, and Form field state across React applications. Choose between standalone devtools for individual libraries or a unified panel combining all three with plugin architecture.

no license declared → metadata onlyupdated Mar 2026
★ 13repo stars

More skills state-management (MIT) · tanstack-cli (MIT) · Tanstack Hotkeys (unlicensed) · App Renderer Systems (unlicensed) · Electricsql (unlicensed) · Local First (unlicensed) · tanstack-query (MIT) · Tanstack Db (unlicensed)

Tags
data-fetching-libraryserver-state-synccache-managementasync-query-handlerapi-integration-toolbackground-syncrequest-deduplicationstale-data-handling