mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Closes: https://linear.app/vercel/issue/DOC-6221/nextjs-split-route-segments-files-in-preparation-for-instant
23 lines
1021 B
Plaintext
23 lines
1021 B
Plaintext
---
|
|
title: dynamicParams
|
|
description: API reference for the dynamicParams route segment config option.
|
|
---
|
|
|
|
The `dynamicParams` option allows you to control what happens when a dynamic segment is visited that was not generated with [generateStaticParams](/docs/app/api-reference/functions/generate-static-params).
|
|
|
|
```tsx filename="layout.tsx | page.tsx" switcher
|
|
export const dynamicParams = true // true | false
|
|
```
|
|
|
|
```js filename="layout.js | page.js | route.js" switcher
|
|
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](/docs/app/api-reference/config/next-config-js/cacheComponents) is enabled.
|