0
0
NextJSframework~5 mins

Zero bundle size for server components in NextJS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does "Zero bundle size for server components" mean in Next.js?
It means server components do not add any JavaScript to the client bundle. They run only on the server, so the client downloads less code, making the app faster.
Click to reveal answer
beginner
Why do server components have zero bundle size on the client?
Because server components render HTML on the server and send it to the client without sending their JavaScript code, so no client-side JavaScript is needed for them.
Click to reveal answer
intermediate
How does zero bundle size for server components improve user experience?
It reduces the amount of JavaScript the browser downloads and runs, leading to faster page loads and less CPU work on the user's device.
Click to reveal answer
intermediate
Can server components use client-side hooks like useState or useEffect?
No, server components cannot use client-side hooks because they run only on the server and do not have access to browser APIs or client state.
Click to reveal answer
advanced
What happens if you import a client component inside a server component in Next.js?
The client component and its JavaScript will be bundled and sent to the client, but the server component itself remains zero bundle size.
Click to reveal answer
What is the main benefit of zero bundle size for server components?
AMakes the server components run on the client
BAllows using client-side hooks on the server
CEnables offline support automatically
DFaster page loads by sending less JavaScript to the client
Where do server components run in Next.js?
ABoth server and client
BOnly on the server
COnly on the client
DIn the browser's service worker
Which hook is NOT allowed in server components?
AuseState
BuseMemo
CuseCallback
DuseServerAction
If a server component imports a client component, what happens?
AClient component code is bundled and sent to the client
BClient component code stays on the server
CServer component loses zero bundle size
DThe app crashes
Zero bundle size helps improve which of the following?
AServer CPU usage
BDatabase query speed
CJavaScript bundle size on the client
DCSS styling
Explain how zero bundle size for server components works and why it matters for web performance.
Think about what code the browser downloads and runs.
You got /4 concepts.
    Describe the difference between server components and client components in Next.js regarding bundling and execution.
    Focus on where the code runs and what is sent to the browser.
    You got /4 concepts.