Next.js Discord

Discord Forum

router.push overwriting previous param

Unanswered
Sphecid wasp posted this in #help-forum
Open in Discord
Sphecid waspOP
Hi, I'm calling router.push(`page2/${param2}`) in a page being rendered by the route /page1/[param1] but param1 is being overwritten thus shortening the intended route to /page1/page2/param2. The page for param2 is nested in the folder for param1. The structure is page1/[param1]/page2/[param2]. Is this the expected behavior or am I doing something wrong? My workaround was prefixing the URL I'm pushing with param1 but it seems like I'm missing something.

0 Replies