Next.js Discord

Discord Forum

Dyanmic routing - how?

Answered
Havana posted this in #help-forum
Open in Discord
HavanaOP
Hi all.

I'm using app router, and i have a page under /clients.

I want to create a new route that is /clients/:id, for example.

how can i achieve this?

3 Replies

Answer
app/clients/[id]/page.tsx

In that page you will receive the following props

interface PageParams {
  id: string;
}

export default function Page({ params }: PageParams) {
  ...
}
HavanaOP
Ahh thanks guys works great, i was looking in the docs at the old page router, ty