Next.js Discord

Discord Forum

App routing

Unanswered
Chestnut-backed Chickadee posted this in #help-forum
Open in Discord
Chestnut-backed ChickadeeOP
How can i do page routing dynamically
product/1 ==> should show details page
product/laptop ===> should show listing page

1 Reply

You can have only one generateStaticParams function per route segment, so in this case you would have to generate both sets of pages in the same place and pass down an extra parameter to control what layout will be rendered for each page