What problem does it solve? Managing asynchronous server state in React with raw useEffect and useState leads to duplicated requests, stale caches, and missing loading or error states. This Skill provides production-grade TanStack Query patterns for declarative data fetching, cache invalidation, optimistic updates, and SSR hydration. ## Core Features & Use Cases - Query & Mutation Patterns: Custom hook abstractions, array-based query key factories, staleTime/gcTime configuration, and cache invalidation after mutations. - Optimistic Updates: Instant UI feedback with onMutate cache snapshots, rollback on error, and refetch on settle. - Next.js App Router Integration: QueryClientProvider setup, server-side prefetchQuery, and HydrationBoundary dehydration for zero-request client hydration. - Use Case: Refactor a component that fetches user data with useEffect into a typed useUser custom hook with a 5-minute staleTime, then add an optimistic update mutation for editing the user profile. ## Quick Start Ask the assistant to refactor a React component that fetches data with useEffect into a TanStack Query custom hook with proper query keys and cache invalidation.