mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
The `Link` component has built in prefetch deduping behavior that was added for pages router, since pages only supports a single kind of prefetch. Both pages & app routers share the `Link` component, meaning the deduping behavior was enabled for both. However, app router supports different [prefetch types](https://nextjs.org/docs/app/api-reference/components/link#prefetch). This means that if a page contains a link to a URL with auto prefetching, followed by a URL with `prefetch={true}`, the full prefetch would not be applied because it was short-circuited by `Link`. Closes NDX-124
20 lines
410 B
JavaScript
20 lines
410 B
JavaScript
import Link from 'next/link'
|
|
import React from 'react'
|
|
|
|
export default function Page() {
|
|
return (
|
|
<>
|
|
<div>
|
|
<Link href="/force-dynamic/test-page">
|
|
/force-dynamic/test-page (prefetch: auto)
|
|
</Link>
|
|
</div>
|
|
<div>
|
|
<Link href="/force-dynamic/test-page" prefetch>
|
|
/force-dynamic/test-page (prefetch: true)
|
|
</Link>
|
|
</div>
|
|
</>
|
|
)
|
|
}
|