Nextjs dynamic routes


the page file needs:

Important: The returned list is not just an array of strings — it must be an array of objects that look like the comment above. Each object must have the params key and contain an object with the id key (because we’re using [id] in the file name). Otherwise, getStaticPaths will fail.

return [
    params: {
      // Statically Generates /posts/a/b/c
      id: ['a', 'b', 'c'],

And will be an array in getStaticProps:

export async function getStaticProps({ params }) {
// will be like ['a', 'b', 'c']