How to use getStaticPaths on dynamic routes in Next.js

Daminda Dinesh Imaduwa Gamage
6 min readJul 20, 2022

What is getStaticPaths?

getStaticPaths is another special function in Next.js used in conjunction with getStaticProps for dynamic routes. In other words, you can use getStaticPaths on a page that uses a dynamic route, and whenever you use this function on that page, there must be a getStaticProps function as well.

[sample].js

What is a Master-Detail UI pattern?

--

--