mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Fixes an issue in self-hosted and Vercel Adapter that causes some routes that prerender static pages to include more route params than expected when running in Cache Components. For all Next.js environments any route matching a root param not already in the cache will result in a prerender that includes all params regardless of whether they were omitted from generateStaticParams. For Vercel Adapter environments any route without a fallback that has an empty shell during the build will prerender misses with all params regardless of whether they were omitted from generateStaticParams. This change fixes both issues and introduces a comprehensive test matrix to catch regressions in these kinds of prerender decisions in the future closes NAR-882
17 lines
633 B
TypeScript
17 lines
633 B
TypeScript
import { ReactNode } from 'react'
|
|
|
|
// Root layout for the dynamic-param/with-root-param TOMBSTONE. Note the
|
|
// placement: this root layout sits ABOVE the catch-all segment, so the
|
|
// segment params are NOT root params — which is exactly why this route can
|
|
// build while the combination it documents cannot: a real
|
|
// with-root-param branch would put the root layout inside [lang], and root
|
|
// params must be provided by generateStaticParams, which the dynamic-param
|
|
// matrix doesn't have.
|
|
export default function Root({ children }: { children: ReactNode }) {
|
|
return (
|
|
<html>
|
|
<body>{children}</body>
|
|
</html>
|
|
)
|
|
}
|