Dependent client-side fetches
Why it matters
A SWR/React Query hook whose key or enabled waits for another hook's data starts only after the first request finishes, and both start only after hydration: two serial round trips before the content shows.
Fix
Fetch on the server and pass the data down, or serve both from one endpoint.
Credit
References
- Conditional FetchingSWR
- Dependent QueriesTanStack Query
- Fetching DataNext.js