{"enrichment":{"faq":[{"a":"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.","q":"What is Tanstack Query and how does it work?"},{"a":"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\u2014you control when and how cached data refreshes.","q":"How does Tanstack Query handle data fetching and caching?"},{"a":"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.","q":"Can Tanstack Query replace Redux for server-side state?"},{"a":"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.","q":"How do you manage async queries and server state synchronization?"},{"a":"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\u2014focus on defining queryFn and invalidation strategy.","q":"What are the best practices for using Tanstack Query?"},{"a":"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.","q":"How does Tanstack Query handle background data updates?"}],"shadow_tags":["data-fetching-library","server-state-sync","cache-management","async-query-handler","api-integration-tool","background-sync","request-deduplication","stale-data-handling"],"summary_rewrite":"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\u2014you 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."},"gist":{"api_url":"https://skillfed.io/api/skills/oakoss/agent-skills/tanstack-query.json","as_of":"2026-03-02","description":"TanStack Query manages server state and data fetching in React with automatic caching, deduplication. npx skillfed install oakoss/agent-skills/tanstack-query","install":{"manual":["git clone https://github.com/oakoss/agent-skills","cp -r agent-skills ~/.claude/skills/tanstack-query"],"primary":"npx skillfed install oakoss/agent-skills/tanstack-query","version":"f6fdb9d0"},"kind":"skill","mirror_url":"https://skillfed.io/oakoss/agent-skills/tanstack-query.md","similar":[{"id":"secondsky/claude-skills/tanstack-query","name":"tanstack-query","publisher":"secondsky/claude-skills","url":"https://skillfed.io/secondsky/claude-skills/tanstack-query"},{"id":"tanstack-skills/tanstack-skills/tanstack-query","name":"tanstack-query","publisher":"tanstack-skills/tanstack-skills","url":"https://skillfed.io/tanstack-skills/tanstack-skills/tanstack-query"},{"id":"AsyrafHussin/agent-skills/state-management","name":"state-management","publisher":"AsyrafHussin/agent-skills","url":"https://skillfed.io/AsyrafHussin/agent-skills/state-management"},{"id":"bobmatnyc/claude-mpm-skills/tanstack-query","name":"tanstack-query","publisher":"bobmatnyc/claude-mpm-skills","url":"https://skillfed.io/bobmatnyc/claude-mpm-skills/tanstack-query"},{"id":"arraydude/agent-skills/react-query-best-practices","name":"react-query-best-practices","publisher":"arraydude/agent-skills","url":"https://skillfed.io/arraydude/agent-skills/react-query-best-practices"}],"title":"Tanstack Query by oakoss: Fetch and cache server data efficiently in React applications \u2014 SkillFed","use":{"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."]},"what":{"lead":"TanStack Query manages server state and data fetching in React with automatic caching, deduplication, and background updates.","rest":"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\u2014you 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."}},"id":"oakoss/agent-skills/tanstack-query","install":{"mode":"external","repo":"https://github.com/oakoss/agent-skills"},"links":{"html":"https://skillfed.io/oakoss/agent-skills/tanstack-query","md":"https://skillfed.io/oakoss/agent-skills/tanstack-query.md","repo":"https://github.com/oakoss/agent-skills"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":5,"language":"Python","last_updated":"2026-03-02","license":null,"name":"Tanstack Query","publisher":"oakoss","stars":13},"relations":{"similar":[{"id":"secondsky/claude-skills/tanstack-query"},{"id":"tanstack-skills/tanstack-skills/tanstack-query"},{"id":"AsyrafHussin/agent-skills/state-management"},{"id":"patricio0312rev/skills/tanstack-query-setup"},{"id":"bobmatnyc/claude-mpm-skills/tanstack-query"},{"id":"arraydude/agent-skills/react-query-best-practices"},{"id":"gohypergiant/agent-skills/accelint-tanstack-query-best-practices"},{"id":"Mindrally/skills/tanstack-query"},{"id":"emanueleielo/deepagents-open-lovable/data-fetching"},{"id":"secondsky/claude-skills/pinia-colada"}]},"slug":{"owner":"oakoss","repo":"agent-skills","skill":"tanstack-query"},"version":"f6fdb9d0"}
