If I use getStaticProps and use the data to render a page like a table of contents, is NextJS smart enough to follow those links and call getStaticProps to statically render those pages statically too?
In this example /page/[id].js is a dynamic page.
//inside: index.js
export function Page({list}) {
return (
<div>
{list.map(item => <Link href={'/page/'+item.id}><a>{item.title}</a></Link>)}
</div>
);
}
export async getStaticProps(() => {
var list = await fetch(...);
return {props: list};
});
Or am I required to use getStaticPaths to explicitly declare all those links?