Unify Link and Form prefetching (#76184)
This updates the Form component to use the same visibility tracking implementation as the Link component. It's basically the same changes that were introduced in https://github.com/vercel/next.js/pull/74670. The resulting improvements are the same as those for Link: - Prefetches are initiated directly inside the IntersectionObserver, not in a useEffect. - Prefetches initiated by a form component will be canceled if the form exits the viewport (if the Segment Cache is enabled). - Prefetches will be re-triggered when the cache is invalidated (if the Segment Cache is enabled).
Showing
This diff is collapsed.
Please
register
or
sign in
to comment