pages/post/[postId]/[commentId].js => /post/post-1/comments/comment-1
{ postId: 'post-1', commentId: 'comment-1' }
<Link href="/post/[postId]/comments/[commentId]" as={`/post/${postId}/comments/${commentId}`} > <a>Link to comment</a> </Link>
Get to know how to easily access 2 route params in Next.js to get the paramets and perform an action
Created on Feb 13, 2022
•150 views
pages/post/[postId]/[commentId].js => /post/post-1/comments/comment-1
{ postId: 'post-1', commentId: 'comment-1' }
<Link href="/post/[postId]/comments/[commentId]" as={`/post/${postId}/comments/${commentId}`} > <a>Link to comment</a> </Link>
If you like our tutorial, do make sure to support us by being our Patreon or buy us some coffee ☕️
Load comments for How to Access Next.js 2 Route Params
Collection of Tailwind CSS components for everyone to use. Browse all of the components that are right for your project.
View Components1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago