Skip to content
This repository has been archived by the owner on Nov 21, 2021. It is now read-only.

getStaticProps #7

Closed
egoist opened this issue Apr 12, 2020 · 1 comment
Closed

getStaticProps #7

egoist opened this issue Apr 12, 2020 · 1 comment

Comments

@egoist
Copy link
Collaborator

egoist commented Apr 12, 2020

Page component can export function getStaticProps, and we will run it on the server side at build time.

Since it's only used in build time you can't access stuff like req.query, if the route path contains paramater like /post/:slug, you also need to export a function getStaticPaths which returns a set of static paths so we can use it to render the page.

@egoist
Copy link
Collaborator Author

egoist commented Apr 13, 2020

Implemented!

@egoist egoist closed this as completed Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant