Next.js · Junior · Question 26 of 75
What does getStaticPaths do in the Pages Router?
- ✓Correct answer: Returns the paths of a dynamic route to build
- 2Returns all static files from the
publicfolder - 3Defines redirects and rewrites for static pages
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.