diff --git a/docs/02-app/01-building-your-application/01-routing/10-router-handlers.mdx b/docs/02-app/01-building-your-application/01-routing/10-router-handlers.mdx index 0d74b5375c75f..3bc5b740e53d0 100644 --- a/docs/02-app/01-building-your-application/01-routing/10-router-handlers.mdx +++ b/docs/02-app/01-building-your-application/01-routing/10-router-handlers.mdx @@ -365,19 +365,21 @@ export async function GET(request) { Route Handlers can use [Dynamic Segments](/docs/app/building-your-application/routing/dynamic-routes) to create request handlers from dynamic data. -```ts filename="app/items/[slug]/route.js" +```ts filename="app/items/[slug]/route.ts" switcher export async function GET( request: Request, - { - params, - }: { - params: { slug: string } - } + { params }: { params: { slug: string } } ) { const slug = params.slug // 'a', 'b', or 'c' } ``` +```js filename="app/items/[slug]/route.js" switcher +export async function GET(request, { params }) { + const slug = params.slug // 'a', 'b', or 'c' +} +``` + | Route | Example URL | `params` | | --------------------------- | ----------- | --------------- | | `app/items/[slug]/route.js` | `/items/a` | `{ slug: 'a' }` |