0
0
NextJSframework~5 mins

Server component execution model in NextJS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Server Component in Next.js?
A Server Component is a React component that runs only on the server. It fetches data and renders HTML before sending it to the browser, improving performance and SEO.
Click to reveal answer
beginner
How does the Server Component execution model improve app performance?
By running components on the server, it reduces JavaScript sent to the client, speeds up page load, and allows data fetching without blocking the UI.
Click to reveal answer
beginner
Where does the Server Component code run in Next.js?
Server Component code runs only on the server during the rendering phase. It never runs in the browser.
Click to reveal answer
intermediate
What happens when a Server Component fetches data?
The data is fetched on the server before rendering. The server sends fully rendered HTML to the client, so the browser shows content immediately.
Click to reveal answer
intermediate
Can Server Components use React hooks like useState or useEffect?
No. Server Components cannot use client-only hooks like useState or useEffect because they do not run in the browser.
Click to reveal answer
Where does a Next.js Server Component run?
ABoth server and browser
BOnly in the browser
COnly on the server
DOn the client side only
What is a key benefit of Server Components in Next.js?
AThey reduce JavaScript sent to the client
BThey allow useState on the server
CThey run faster in the browser
DThey replace API routes
Can Server Components use useEffect hook?
AYes, always
BNo, because they don't run in the browser
COnly with special flags
DOnly in development mode
How does data fetching work in Server Components?
AData is fetched on the server before rendering
BData is fetched after the page loads in the browser
CData fetching is not allowed
DData is fetched using client-side hooks
What does the browser receive from a Server Component?
ANo content until client runs code
BRaw React code
COnly JavaScript
DFully rendered HTML
Explain how the Server Component execution model works in Next.js and why it improves performance.
Think about where the code runs and what the browser receives.
You got /5 concepts.
    Describe the limitations of Server Components regarding React hooks and client-side interactivity.
    Consider what hooks need the browser environment.
    You got /4 concepts.