TanStack Query — server state management with caching, background refetch, pagination, and optimistic updates.
Five passes over the same idea, each from a different angle. Do them in order, or jump to whichever you need.
React Query (TanStack Query) treats server state as a separate concern from client state. It provides automatic caching, background refetching, stale-while-revalidate, pagination, infinite queries, and optimistic updates. Query keys enable cache invalidation. Mutations handle writes with rollback support.