mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
To assist with the development and testing of the new partial prerendering (PPR) paradigm, this introduces a stop-gap solution to let us verify issues with pages in preview and production environments if enabled. When a Next.js app is built and ran with the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING=1` environment variable, pages that have PPR enabled in production and preview environments can have only their static shell served when accessed with a `?__nextppronly=1` query parameter. If your project is not using PPR, it will not change anything. If a page is accessed in production or development with the query parameter but PPR is not enabled, it will not change anything. Tests have been added to validate that going forward.
18 lines
310 B
React
18 lines
310 B
React
import { unstable_noStore } from 'next/cache'
|
|
import { Suspense } from 'react'
|
|
|
|
function Dynamic() {
|
|
unstable_noStore()
|
|
return <div>Dynamic</div>
|
|
}
|
|
|
|
export default function Page() {
|
|
return (
|
|
<div>
|
|
<Suspense fallback={<div>Fallback</div>}>
|
|
<Dynamic />
|
|
</Suspense>
|
|
</div>
|
|
)
|
|
}
|