{"enrichment":{"faq":[{"a":"TanStack Query Best Practices recommends 40 prioritized rules across 8 categories. Key optimization strategies include proper query key structure, configuring staleTime and gcTime for effective caching, implementing prefetching to avoid request waterfalls, using useQuery and useMutation patterns correctly, and optimizing renders through selective subscriptions. The guide emphasizes cache configuration as foundational to performance gains.","q":"What are the best practices for optimizing TanStack Query performance?"},{"a":"TanStack Query Best Practices covers cache configuration through query key structure and timing settings. Proper query keys enable automatic cache invalidation and deduplication. Configure staleTime to control when data is considered fresh, and gcTime (formerly cacheTime) to determine how long inactive queries persist. These settings work together to balance data freshness with memory efficiency and network requests.","q":"How should TanStack Query caching strategies be configured correctly?"},{"a":"TanStack Query Best Practices addresses prefetching with queryClient prefetch patterns that load data before components request it. This eliminates request waterfalls where child components wait for parent data. Prefetch strategically during user interactions or route transitions. The guide provides specific patterns for timing and triggering prefetch calls to maximize performance without over-fetching.","q":"What prefetching patterns does TanStack Query recommend to avoid waterfalls?"},{"a":"TanStack Query Best Practices emphasizes mutations should trigger precise query invalidation rather than broad cache clears. Use optimistic updates to improve perceived performance, then validate server responses. Structure invalidation patterns around your query key hierarchy. Handle mutation errors gracefully with rollback strategies. The guide details when to use useMutation hooks and how to coordinate mutations with query state.","q":"What are TanStack Query mutation best practices and data invalidation patterns?"},{"a":"TanStack Query Best Practices covers infinite queries for paginated or load-more patterns. Configure proper query keys to distinguish pages, use getNextPageParam to determine pagination logic, and manage memory by setting appropriate gcTime values. The guide addresses render optimization techniques and error handling specific to infinite query scenarios.","q":"How does TanStack Query handle infinite queries and request optimization?"},{"a":"TanStack Query Best Practices provides guidance on integrating Suspense for loading states and error boundaries for error handling. Configure queries with appropriate retry settings and error states. The guide covers how to structure components to work with Suspense boundaries and handle both query errors and mutation failures through error boundary integration.","q":"How can Suspense and error boundaries integrate with TanStack Query?"}],"shadow_tags":["data-fetching-library","cache-management","query-optimization","async-state-handling","request-deduplication","performance-tuning","client-side-caching","mutation-handling","react-data-layer"],"summary_rewrite":"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."},"files":[{"bytes":5276,"path":"skills/.curated/tanstack-query/SKILL.md","sha256":"2df31e8c38d7f1c39ae26c7efc0358edc155a12355a0dccc09f875868f95f599","url":"https://skillfed.io/files/pproenca/dot-skills/tanstack-query/3cb19e88/SKILL.md"}],"id":"pproenca/dot-skills/tanstack-query","links":{"html":"https://skillfed.io/pproenca/dot-skills/tanstack-query","md":"https://skillfed.io/pproenca/dot-skills/tanstack-query.md","repo":"https://github.com/pproenca/dot-skills"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":14,"language":"Shell","last_updated":"2026-07-24","license":"MIT","name":"tanstack-query","publisher":"pproenca","stars":182},"relations":{"similar":[{"id":"secondsky/claude-skills/tanstack-query"},{"id":"tanstack-skills/tanstack-skills/tanstack-query"},{"id":"DeckardGer/tanstack-agent-skills/tanstack-query"},{"id":"oakoss/agent-skills/tanstack-query"},{"id":"Mindrally/skills/tanstack-query"},{"id":"bobmatnyc/claude-mpm-skills/tanstack-query"},{"id":"pproenca/dot-skills/react-fetch-cache-patterns"},{"id":"patricio0312rev/skills/tanstack-query-setup"},{"id":"secondsky/claude-skills/pinia-colada"},{"id":"AsyrafHussin/agent-skills/state-management"}]},"slug":{"owner":"pproenca","repo":"dot-skills","skill":"tanstack-query"},"version":"3cb19e88"}
