mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This API has experimental modes for build validation but the dev validation is going to be stable in the next release.
30 lines
847 B
TypeScript
30 lines
847 B
TypeScript
// This layout has prefetching disabled because it performs uncached dynamic
|
|
// I/O (connection()). Static parents above it should be able to inline through
|
|
// it and into the static child below, because this layout acts as a transparent
|
|
// pass-through — its slot in the bundle is null but the chain isn't broken.
|
|
import { ReactNode, Suspense } from 'react'
|
|
import { connection } from 'next/server'
|
|
|
|
export const instant = false
|
|
export const prefetch = 'force-disabled'
|
|
|
|
async function DynamicContent() {
|
|
await connection()
|
|
return <p id="layout-instant-false-passthrough">Dynamic layout</p>
|
|
}
|
|
|
|
export default function InstantFalsePassthroughLayout({
|
|
children,
|
|
}: {
|
|
children: ReactNode
|
|
}) {
|
|
return (
|
|
<div>
|
|
<Suspense fallback={<p>Loading...</p>}>
|
|
<DynamicContent />
|
|
</Suspense>
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|