I've been reviewing the documentation for Next.js and believe I grasp the concept of dynamic routing using [slug].js, but I am facing difficulty understanding nested dynamic routes in terms of folder organization.
If I intend to develop an application based on users, how can I implement /user/[userid]/post/[postId]
?
Here is what I would like to achieve:
user
- [id].js // for example, user/1
- [userId]
- - post
- - - [postId].js // for instance, user/[userId]/post/[postId]
However, I am encountering an issue with [slugs] as it appears that having two slugs in the same folder is not allowed.
Can someone provide guidance on the correct folder structure to accomplish this? I would greatly appreciate any assistance.