If you export an `async` function called `getStaticProps` from a page, Next.js will pre-render this page at build time using the props returned by `getStaticProps`.
If you export an `async` function called `getStaticProps` from a page, Next.js will pre-render this page at build time using the props returned by `getStaticProps`.
```jsx
```jsx
...
@@ -364,6 +375,16 @@ This use case is supported by Next.js by the feature called **Preview Mode**. Le
...
@@ -364,6 +375,16 @@ This use case is supported by Next.js by the feature called **Preview Mode**. Le
If a page has dynamic routes ([documentation](/docs/routing/dynamic-routes.md)) and uses `getStaticProps` it needs to define a list of paths that have to be rendered to HTML at build time.
If a page has dynamic routes ([documentation](/docs/routing/dynamic-routes.md)) and uses `getStaticProps` it needs to define a list of paths that have to be rendered to HTML at build time.
If you export an `async` function called `getStaticPaths` from a page that uses dynamic routes, Next.js will statically pre-render all the paths specified by `getStaticPaths`.
If you export an `async` function called `getStaticPaths` from a page that uses dynamic routes, Next.js will statically pre-render all the paths specified by `getStaticPaths`.
...
@@ -453,7 +474,7 @@ export default Post
...
@@ -453,7 +474,7 @@ export default Post
<details>
<details>
<summary><b>Examples</b></summary>
<summary><b>Examples</b></summary>
<ul>
<ul>
<li><a href="https://static-tweet.now.sh">Static generation of a large number of pages</a></li>
<li><a href="https://static-tweet.vercel.app">Static generation of a large number of pages</a></li>
</ul>
</ul>
</details>
</details>
...
@@ -587,6 +608,16 @@ In development (`next dev`), `getStaticPaths` will be called on every request.
...
@@ -587,6 +608,16 @@ In development (`next dev`), `getStaticPaths` will be called on every request.
If you export an `async` function called `getServerSideProps` from a page, Next.js will pre-render this page on each request using the data returned by `getServerSideProps`.
If you export an `async` function called `getServerSideProps` from a page, Next.js will pre-render this page on each request using the data returned by `getServerSideProps`.