mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What? Our current logic of detecting if a route allows dynamic params or not (`fallback`) is flawed, and this PR fixes it. ### Why? Right now, if no `generateStaticParams` is specified we return `fallback: undefined` during dev. However, for an app with multiple params, it may have multiple `generateStaticParams` defined in different levels. If some level isn't covered by any `generateStaticParams`, we still can't determine the fallback value. ### How? I added a naive implementation to check if all params are covered by `generateStaticParams` in the current or inner layers. Closes NEXT-946
14 lines
243 B
JavaScript
14 lines
243 B
JavaScript
import { cookies } from 'next/headers'
|
|
|
|
import Refresh from './refresh'
|
|
|
|
export default function Page() {
|
|
const cookieValue = cookies().get('test-cookie')
|
|
return (
|
|
<>
|
|
<Refresh />
|
|
<h1>{cookieValue?.value}</h1>
|
|
</>
|
|
)
|
|
}
|