I know the title is confusing, but basically, I want to generate a page on a certain event is triggered (i.e. a button is clicked).
For example, when you make an account on a service like twitter, how exactly does it generate a unique page for your profile (like https://www.twitter.com/exampleuser1234)? This has always confused me and I'd love an answer.
I have searched and scanned Google far and wide, and I could not find any clues at all. I don't even know how to start.
CodePudding user response:
This is done using dynamic routes, e.g. /users/[id]
.
You can learn more in the documentation https://nextjs.org/docs/routing/dynamic-routes