From 9d3163804109aa289d622ea914cbe8743cc78147 Mon Sep 17 00:00:00 2001 From: Arfa Ahmed Date: Thu, 7 Nov 2024 14:11:15 +0500 Subject: [PATCH] docs(route-handlers): add TS/JS `switcher` to `Route Resolution` section in `Route Handlers` (#72222) This PR fixes issue on the [Route Handlers](https://nextjs.org/docs/canary/app/building-your-application/routing/route-handlers) documentation page: Missing switcher for TS codeblock in [Route Resolution](https://nextjs.org/docs/canary/app/building-your-application/routing/route-handlers#route-resolution) section. ![image](https://github.com/user-attachments/assets/9263732d-2852-49a5-a718-1f40a060ee64) --------- Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com> --- .../01-routing/13-route-handlers.mdx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/01-app/02-building-your-application/01-routing/13-route-handlers.mdx b/docs/01-app/02-building-your-application/01-routing/13-route-handlers.mdx index 628aae57f26bd..9813880eb1e85 100644 --- a/docs/01-app/02-building-your-application/01-routing/13-route-handlers.mdx +++ b/docs/01-app/02-building-your-application/01-routing/13-route-handlers.mdx @@ -101,7 +101,17 @@ You can consider a `route` the lowest level routing primitive. Each `route.js` or `page.js` file takes over all HTTP verbs for that route. -```jsx filename="app/page.js" +```ts filename="app/page.ts" switcher +export default function Page() { + return

Hello, Next.js!

+} + +// ❌ Conflict +// `app/route.ts` +export async function POST(request: Request) {} +``` + +```js filename="app/page.js" switcher export default function Page() { return

Hello, Next.js!

}