What problem does it solve?
This Skill provides comprehensive guidance and best practices for managing server state effectively using TanStack Query, ensuring efficient data fetching, caching, and synchronization in your applications.
Core Features & Use Cases
- Server State Management: Guides on using
useQuery and useMutation for fetching and updating server data.
- Data Conventions: Establishes conventions for
queryKey naming and the queryKey factory pattern for better organization and invalidation.
- Advanced Patterns: Covers Optimistic Updates, Prefetching, and Suspense mode for enhanced user experience.
- Configuration: Recommends optimal
staleTime, gcTime, and other QueryClient options.
- Use Case: When implementing a feature that displays a list of users and allows for user creation, this Skill will guide you on how to fetch the user list, handle the creation mutation, and ensure the list is updated correctly afterward, all while optimizing for performance and user experience.
Quick Start
Refer to the TanStack Query Skill for rules on using useQuery with queryKey factories.