TanStack Query treats API data as server state: it caches responses by a query key, de-duplicates identical requests, retries failures, refetches stale data on window focus or reconnect, supports polling (refetchInterval) and paginated / infinite queries (placeholderData: keepPreviousData, useInfiniteQuery), and lets you invalidate keys after a mutation so lists refresh. Hand-written useEffect fetches repeat all of that per screen and usually get races and cleanup wrong, so the library mostly buys developer time and fewer bugs.
Use plain fetch for one or two calls; use TanStack Query once several screens share data, you page through large lists, or you need optimistic updates. It does not replace the API's own HTTP caching or authorisation.
Checks whether they understand server-state caching, de-duplication and invalidation.
Last updated 23 Nov 2026.