TanStack Query
tanstack.com
1
Leaving SiteNav
External Link Disclaimer
You are about to visit tanstack.com. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
TanStack Query, formerly known as React Query, is a powerful asynchronous state management library created by Tanner Linsley in 2019, providing a declarative approach to fetching, caching, synchronizing, and updating server state in web applications, with framework support for React, Vue, Solid, and Svelte, adopted by thousands of applications including one hundred eighty thousand weekly npm downloads and companies like Google, Amazon, and Microsoft for managing remote data fetching. The core concept distinguishes server state from client state, recognizing that server state is asynchronous, can be updated by other users, requires caching and invalidation, and needs synchronization across components, with the library providing hooks and functions for managing all aspects of server state including fetching, caching, background updating, garbage collection, and cache invalidation. The query caching engine automatically deduplicates concurrent requests for the same data, caches responses with configurable stale times and garbage collection times, refetches stale data on window focus, network reconnection, and configurable intervals, and provides optimistic updates through the mutation API for instant UI feedback before server confirmation. The query keys provide a hierarchical cache structure using arrays of strings and objects, enabling precise cache invalidation through pattern matching, automatic refetching when dependencies change, and parallel query execution. The infinite query support handles cursor and offset based pagination. The prefetching enables loading data before navigation. The devtools provide visual cache inspection. The SSR support through hydration. The suspense mode. Designed for frontend developers.
Statistics
1
Views
0
Clicks
0
Like
0
Dislike