Recall & Review
beginner
What is server state in Next.js?
Server state is data fetched and stored on the server. It is sent to the client during rendering, often used for initial page load or server-side rendering.
Click to reveal answer
beginner
What is client state in Next.js?
Client state is data managed inside the browser after the page loads. It changes based on user actions without needing to reload the page from the server.
Click to reveal answer
intermediate
Why do we separate server state and client state?
Separating helps manage data efficiently. Server state handles data from APIs or databases, while client state manages UI changes and user input locally.
Click to reveal answer
intermediate
How does Next.js fetch server state?
Next.js uses functions like
getServerSideProps or getStaticProps to fetch server state before rendering pages.Click to reveal answer
beginner
Give an example of client state in a Next.js app.
Client state example: a toggle button that changes color when clicked, managed with React's
useState hook inside the browser.Click to reveal answer
Which Next.js function is used to fetch server state at request time?
✗ Incorrect
getServerSideProps runs on the server at each request to fetch fresh server state.
Client state is usually managed with which React hook?
✗ Incorrect
useState manages client state inside React components.
Which of these is NOT true about server state?
✗ Incorrect
Server state does not update automatically on user clicks without reload; that is client state behavior.
Why might you use client state in a Next.js app?
✗ Incorrect
Client state handles UI changes and user input instantly without server reload.
Which statement best describes server state?
✗ Incorrect
Server state is fetched and prepared on the server before sending to the client.
Explain the difference between server state and client state in Next.js.
Think about where the data lives and when it updates.
You got /4 concepts.
Describe how Next.js handles server state fetching and how client state is managed.
Consider the data flow from server to client and inside the client.
You got /4 concepts.