Answer the question
In order to leave comments, you need to log in
How to use dynamic router in Next.js?
Before that, I used the next-routes library and wrote routes like this:
const routes = require('next-routes')
module.exports = routes()
.add({ name: 'article_detail', pattern: '/:categoty_name/:article_slug', page: 'article_detail' })
<Link route={`/${article.category.name}/${article.slug}`}>
<a>Название статьи</a>
</Link>
/post/first-post
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question