Skip to content
ViraStack
Products
Academy
New
About
Search docs
⌘K
Home
Sources
Contribute
Academy
TanStack Query
Server state, caching, mutations, optimistic updates and prefetching with Next.js.
Fundamentals
01
What server state is
6 Docs
3 Articles
2 Videos
How it differs from client state, the mistakes in fetching with useEffect, and when you don't need it.
02
Setup and devtools
7 Docs
2 Articles
The QueryClient, the defaults that surprise people, Devtools and the ESLint plugin.
03
useQuery and query keys
5 Docs
4 Articles
1 Video
status against fetchStatus, building the key like a dependency array, and cancellation.
04
queryOptions and select
4 Docs
4 Articles
Query factories, typed cache reads and reducing renders by selecting data.
05
Cache and stale time
4 Docs
3 Articles
staleTime against gcTime, the refetch moments, polling and initialData.
06
Mutations and invalidation
5 Docs
2 Articles
useMutation, invalidation, updating from the response and where the callbacks belong.
07
Optimistic updates
2 Docs
2 Articles
Optimistic updates through variables and through the cache, rolling back, and concurrency.
Advanced Use
08
Dependent and parallel queries
7 Docs
2 Articles
useQueries, enabled and skipToken, request waterfalls and prefetching on hover.
09
Pagination and infinite lists
4 Docs
1 Article
1 Video
keepPreviousData, preparing the next page and useInfiniteQuery.
10
Suspense and error handling
5 Docs
2 Articles
A global toast, throwOnError, useSuspenseQuery and retrying after an error.
11
Prefetching with Next.js
4 Docs
1 Article
Starting on the server and streaming, HydrationBoundary and who owns the data.
12
Product admin panel
Project
6 Docs
3 Articles
1 Repo
A panel with pagination, prefetching, Suspense, mutations and optimistic updates.
Previous track
Next.js
Next track
Zustand