State Management · Senior · Question 24 of 75

How do you pass server-prefetched TanStack Query data to client components in the Next.js App Router?

Explanation

A per-request QueryClient prefetches and serializes the cache; the client HydrationBoundary puts it into the browser cache, so useQuery with the same key renders immediately without a refetch.

Further reading

Problem with a question

State Management · Senior · question 24

Test yourself

Take the State Management · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz