Dictionary
TanStack Query
TanStack Query, formerly React Query, is a data synchronization library for fetching, caching, and updating server state in web applications. It handles common challenges of working with remote data: caching responses so repeated requests are instant, background revalidation to keep data fresh, request deduplication when multiple components need the same data, and optimistic updates that make the UI feel responsive before the server confirms changes.
The library provides a declarative API through hooks like useQuery and useMutation that replace manual state management for loading, error, and success states. Automatic garbage collection removes unused cache entries, and window focus refetching ensures data is current when users return to the tab. While originally built for React, TanStack Query now supports Vue, Solid, and Svelte. For web developers building data-intensive applications, it eliminates significant boilerplate code that would otherwise be needed to manage server state reliably.