Add <Link prefetch="navigation"> (#99871)
`await navigation()` prevents certain parts of a page from being
rendered as part of a Link's prefetch (`<Link prefetch={true}>`).
However, there are cases where you may wish to override that behavior
and forcibly prefetch past that boundary. For example, if you have high
confidence that the user will interact with a particular link.
This PR adds three new options for a Link's prefetch prop: `"shell"`,
`"prefetch"`, and `"navigation"`.
`"shell"` and `"prefetch"` exist mostly for consistency — a value of
`"shell"` has the same behavior as a missing prefetch prop, and
`"prefetch"` has the same behavior as `true`. It's only `"navigation"`
that introduces novel functionality.
The naming scheme intentionally mirrors the `await prefetch()` and
`await navigation()` APIs introduced in version 16.4. They correspond to
the same conceptual stages.
---------
Co-authored-by:
Janka Uryga <lolzatu2@gmail.com>
Showing
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Please
register
or
sign in
to comment