Next.js · Junior · Question 25 of 75
When does getServerSideProps run in the Pages Router?
- ✓Correct answer: On the server on every request
- 2Once at build time
- 3In the browser during hydration
Explanation
getServerSideProps is SSR in the Pages Router: the function receives the request context (cookies, query) and returns props. At build time, getStaticProps runs instead. In the App Router, both APIs are replaced by async server components.