mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This adds an unstable option to the Link component's called
`unstable_dynamicOnHover`. When set to true, the Link will initiate a
dynamic prefetch as soon as the link is hovered.
This is roughly equivalent to updating the prefetch prop to `true`
inside a mouse event handler.
Because this results in dynamic prefetching, semantically it has the
same implication as `prefetch={true}` — by the time the navigation
occurs, the target page's data may be slightly stale.
16 lines
342 B
TypeScript
16 lines
342 B
TypeScript
import { Suspense } from 'react'
|
|
import { connection } from 'next/server'
|
|
|
|
async function DynamicContent() {
|
|
await connection()
|
|
return <div id="dynamic-content">Dynamic content</div>
|
|
}
|
|
|
|
export default function Page() {
|
|
return (
|
|
<Suspense fallback={<div>Loading dynamic data...</div>}>
|
|
<DynamicContent />
|
|
</Suspense>
|
|
)
|
|
}
|