Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use static regeneration #25

Merged
merged 2 commits into from Jan 18, 2022
Merged

Use static regeneration #25

merged 2 commits into from Jan 18, 2022

Conversation

TijsM
Copy link
Owner

@TijsM TijsM commented Jan 18, 2022

No description provided.

@vercel
Copy link

vercel bot commented Jan 18, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tijsm/rodi/ByragkCAWisd12ZJqHtviQa3PQUf
✅ Preview: https://rodi-git-use-static-regeneration-tijsm.vercel.app

Copy link

@thgh thgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

Als je de getStaticPaths weglaat, krijg je incremental static generation, dus 1 keer traag, daarna snel.

@TijsM
Copy link
Owner Author

TijsM commented Jan 18, 2022

@thgh als ik getStaticPaths weg liet kreeg ik volgende error

image

om getStaticProps te kunnen kunnen gebruiken met dynamic pages moet je ds ook getStaticPaths gebruiken.

dit staat ook in de docs van getStaticPaths:

If a page has Dynamic Routes and uses getStaticProps, it needs to define a list of paths to be statically generated.

@TijsM TijsM merged commit 4cca00c into main Jan 18, 2022
@thgh
Copy link

thgh commented Jan 18, 2022

Aha oeps, als er een path opgevraagd wordt dat niet in getStaticPaths zit, dan werkt het ook (als fallback:blocking is). Ik dacht daarom dat het optioneel was.

zoiets:

export async function getStaticPaths() {
  return { paths:[], fallback: 'blocking' }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants