getStaticPaths

Used in conjunction with getStaticProps to specify dynamic routes at build time.

Snippet:

export async function getStaticPaths() { return { paths: [{ params: { id: "1" } }], fallback: false }; }

Example:

export async function getStaticPaths() { const paths = await fetchPaths(); return { paths, fallback: true }; }