Next.js · Junior · Question 26 of 75

What does getStaticPaths do in the Pages Router?

Explanation

For a pages/posts/[id].tsx page with getStaticProps, Next.js needs to know which ids to build ahead of time. The fallback option defines behavior for other paths. The App Router counterpart is generateStaticParams.

Further reading

Problem with a question

Next.js · Junior · question 26

Test yourself

Take the Next.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz