getStaticProps
getStaticProps is a special asynchronous function that you can export from a page in Next.js. Its primary purpose is to pre-render a page at build time. When Next.js builds your application, it will execute getStaticProps. The data returned from getStaticProps will be passed to the page component as props. This means the page will be generated as static HTML before the user requests it.
This function runs only on the server-side. It will not be included in the client-side JavaScript bundle.
You can also use getStaticProps to fetch data for dynamic routes. For example, if you have a
The function must return an object containing a props property. This props object will be passed to