Next.js · Junior · Question 62 of 75

What is the useLinkStatus hook for?

function Hint() {
  const { pending } = useLinkStatus()
  return <span className={pending ? 'spinner' : ''} />
}

Explanation

It must be used in a descendant of <Link>. Prefer loading.tsx and prefetching for instant navigations; the hook is a patch for slow transitions.

Further reading

Problem with a question

Next.js · Junior · question 62

Test yourself

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

Take this quiz