Next.js · Junior · Question 25 of 75

When does getServerSideProps run in the Pages Router?

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.

Further reading

Problem with a question

Next.js · Junior · question 25

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