Skip to content
Discussion options

You must be logged in to vote

I couldn't find any way to achieve this using next routes.

You should've kept searching then, it's not that hard to find. :)
Its right here: https://nextjs.org/docs/routing/dynamic-routes#catch-all-routes
You put it like this: [...params] and get an array of values.

There also is the concept of optional catchall routes which currently is experimental:
https://nextjs.org/docs/routing/dynamic-routes#optional-catch-all-routes
But it looks like you may not need that, as the username param seems to be always present.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@dipta007
Comment options

@janus-reith
Comment options

@janus-reith
Comment options

Answer selected by dipta007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants