Data Fetching in React: From fetch + Effects to TanStack Query, Suspense and use()
Fetching in an effect gives you no cache, deduplication, retries or invalidation; TanStack Query gathers them around the query key. We move the Bookstore catalog and the server-side cart to TanStack Query and measure a revisited search coming from the cache, an optimistic update rolled back on a 500, a 409 Problem Details shown to the user, Suspense's 300 ms reveal window, and a promise created during render sending 3,739 requests through use() in three seconds.
15 Nov 2026
·
20 min
·
4