Just diving into the world of Next.js. I've been going through the Next.js documentation and stumbled upon this:
Next.js creates a JSON file that contains the outcome of executing
getStaticProps
. This JSON file is used in client-side routing vianext/link
ornext/router
. When you go to a page pre-rendered withgetStaticProps
, Next.js retrieves this JSON file (pre-computed during build time) and uses it as the props for the page component.
My question is, what's the purpose of this JSON file? If the page is statically rendered into HTML during build time using the props from getStaticProps
, why does the page component need those props at runtime?