#You cannot use different slug names for the same dynamic path

1 messages · Page 1 of 1 (latest)

winter hearth
#

What you're asking for isn't very clear without more example routes.

#

The reason why you can't just name the same dynamic segment a bunch of different ways is there's no way for nextjs to know which one you intent to use, for a given url.

#

A typical newbie mistake would be something like

/posts/[postId].tsx
/posts/[page].tsx
#

That won't work because there's no way for next to figure out when you navigate to yoururl.com/posts/someroute whether someroute should be params.postId or params.page.