What problem does it solve?
This Skill provides a comprehensive set of rules and guidelines to ensure TanStack Query (React Query) is implemented effectively, preventing common pitfalls and optimizing data fetching, caching, and state management in React applications.
Core Features & Use Cases
- Optimized Data Fetching: Implement best practices for query keys, caching, and refetching to minimize network requests and improve performance.
- Robust State Management: Ensure data integrity and consistency through proper mutation handling, error management, and optimistic updates.
- Advanced Patterns: Leverage techniques like prefetching, infinite queries, and SSR integration for a seamless user experience.
- Use Case: When building a dashboard that displays real-time data, user profiles, and lists of items, applying these best practices ensures the data loads quickly, stays fresh, and updates responsively without overwhelming the server or causing UI glitches.
Quick Start
Activate the tanstack-query-best-practices skill to review the rules for optimizing data fetching and caching in your React application.