I've been going over the Next.js docs and think I understand the [slug].js dynamic routing process, but I struggling to understand nested dynamic routes in terms of folder structure.
If I want to make a user based application, how would I achieve /user/[userid]/post/[postId]?
And a would like something like this:
user
- [id].js // e.g. user/1
- [userId]
- - post
- - - [postId].js // e.g. user/[userId]/post/[postId]
But this throws an error about [slugs] as I think you can't have two slugs in the same folder.
Can anyone explain the correct folder structure to achieve this? Any help with be greatly appreciated.