Consider a Next.js app with a <Link> component that has prefetch enabled (default behavior). What does Next.js do when this component appears on the page?
<Link href="/about">About</Link>Think about how Next.js improves navigation speed by loading pages early.
By default, Next.js prefetches linked pages' JavaScript and data in the background after the page loads to speed up navigation.
Given this code snippet, what will be the user experience difference compared to default prefetch behavior?
<Link href="/contact" prefetch={false}>Contact</Link>Disabling prefetch means Next.js won't load the page early.
Setting prefetch={false} stops Next.js from loading the page in the background, so navigation waits until click.
Choose the correct way to disable prefetching on a Next.js Link component.
Remember that prefetch expects a boolean value.
The prefetch prop expects a boolean. Passing a string or other types won't disable prefetch correctly.
Given a dynamic route /posts/[id] and this Link:
<Link href="/posts/[id]" as="/posts/123">Post 123</Link>Why might Next.js not prefetch this page?
Think about how Next.js needs to know the exact path to prefetch.
Next.js requires the href prop to include the dynamic parameters to prefetch correctly. Using as alone does not provide enough info.
Which of the following best describes when Next.js triggers prefetching for a Link component?
Consider how Next.js balances performance and user experience by prefetching only visible links.
Next.js prefetches routes for Link components that are visible in the viewport after the page loads to avoid unnecessary network usage.