Recall & Review
beginner
What is server-side state passing in Next.js?
It means sending data from the server to the client during page rendering, so the page loads with the needed information already available.
Click to reveal answer
beginner
Which Next.js function is commonly used to fetch data on the server before rendering a page?
getServerSideProps is used to fetch data on the server at request time and pass it as props to the page component.Click to reveal answer
intermediate
How does
getServerSideProps help with SEO?Because data is fetched on the server and included in the HTML sent to the browser, search engines can see the full content immediately.
Click to reveal answer
intermediate
What is the difference between
getServerSideProps and getStaticProps in Next.js?getServerSideProps runs on every request to fetch fresh data, while getStaticProps runs at build time to generate static pages.Click to reveal answer
advanced
Why should you avoid putting sensitive information directly in the props returned by
getServerSideProps?Because props are sent to the client and can be seen by users, sensitive data should be kept secure and not exposed in props.
Click to reveal answer
Which Next.js function fetches data on the server for each request?
✗ Incorrect
getServerSideProps runs on the server at every request to fetch data.What does server-side state passing improve in a Next.js app?
✗ Incorrect
Passing state from server helps pages load faster with data and improves SEO by sending full HTML.
Where is the data returned by
getServerSideProps available?✗ Incorrect
Data returned by
getServerSideProps is passed as props to the page component.Which method runs only once at build time in Next.js?
✗ Incorrect
getStaticProps runs once at build time to generate static pages.Why avoid sending sensitive data in server-side props?
✗ Incorrect
Props are sent to the client and can be viewed, so sensitive data should not be included.
Explain how server-side state passing works in Next.js and why it is useful.
Think about how data is prepared before the page reaches the browser.
You got /4 concepts.
Describe the difference between getServerSideProps and getStaticProps in Next.js.
Consider when the data is fetched and how often.
You got /4 concepts.