dynamicParams
The dynamicParams option allows you to control what happens when a dynamic segment is visited that was not generated with generateStaticParams.
layout.tsx | page.tsx
export const dynamicParams = true // true | falselayout.js | page.js | route.js
export const dynamicParams = true // true | falsetrue(default): Dynamic route segments not included ingenerateStaticParamsare generated at request time.false: Dynamic route segments not included ingenerateStaticParamswill return a 404.
Good to know:
- This option replaces the
fallback: true | false | blockingoption ofgetStaticPathsin thepagesdirectory.
With Cache Components
dynamicParams is not available when Cache Components is enabled. Paths not returned by generateStaticParams are handled at request time. Call notFound() in the page when the requested resource does not exist to render the not-found UI. See Status codes for how streaming affects the HTTP status.