Next.js · Middle · Question 22 of 75

What do you call in a client component to refetch the current route's server components?

Explanation

router.refresh() makes a new request to the server and re-renders server components while preserving React and browser client state (scroll, typed input). location.reload() resets everything. In Server Actions, the counterpart is the refresh() function from next/cache.

Further reading

Problem with a question

Next.js · Middle · question 22

Test yourself

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

Take this quiz