Next.js · Senior · Question 51 of 75

With Partial Prefetching enabled, what does await prefetch() inside a component do?

async function Recommendations() {
  await prefetch()
  const items = await getRecommendations()
  return <List items={items} />
}

Explanation

The nearest <Suspense> fallback goes into the shell instead. It requires cacheComponents and has no effect without partialPrefetching.

Further reading

Problem with a question

Next.js · Senior · question 51

Test yourself

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

Take this quiz