Complete the code to add prefetching to a Remix Link component.
import { Link } from '@remix-run/react'; export default function Nav() { return <Link to="/about" prefetch=[1]>About</Link>; }
The prefetch prop with value "hover" tells Remix to prefetch the linked page when the user hovers over the link.
Complete the code to prefetch a link only when the user intends to navigate.
import { Link } from '@remix-run/react'; export default function Nav() { return <Link to="/contact" prefetch=[1]>Contact</Link>; }
The "intent" value prefetches when the user shows intent to navigate, like focusing or touching the link.
Fix the error in the code to correctly prefetch the link on visibility.
import { Link } from '@remix-run/react'; export default function Nav() { return <Link to="/blog" prefetch=[1]>Blog</Link>; }
Using "visible" prefetches the linked page when the link is visible in the viewport.
Fill both blanks to create a prefetching link that prefetches on hover and has an accessible label.
import { Link } from '@remix-run/react'; export default function Nav() { return <Link to="/services" prefetch=[1] aria-label=[2]>Services</Link>; }
Using "hover" for prefetch triggers prefetch on mouse hover. Adding an aria-label like "Go to services page" helps screen readers understand the link.
Fill all three blanks to create a prefetching link with hover prefetch, an aria-label, and a CSS class for styling.
import { Link } from '@remix-run/react'; export default function Nav() { return <Link to="/portfolio" prefetch=[1] aria-label=[2] className=[3]>Portfolio</Link>; }
This link prefetches on hover ("hover"), has an accessible label ("Visit portfolio page"), and uses a CSS class ("nav-link") for styling.
