Back to Next Js

dynamicParams

docs/01-app/03-api-reference/03-file-conventions/02-route-segment-config/dynamicParams.mdx

16.2.5912 B
Original Source

The dynamicParams option allows you to control what happens when a dynamic segment is visited that was not generated with generateStaticParams.

tsx
export const dynamicParams = true // true | false
js
export const dynamicParams = true // true | false
  • true (default): Dynamic route segments not included in generateStaticParams are generated at request time.
  • false: Dynamic route segments not included in generateStaticParams will return a 404.

Good to know:

  • This option replaces the fallback: true | false | blocking option of getStaticPaths in the pages directory.
  • dynamicParams is not available when Cache Components is enabled.