0
0
NextJSframework~5 mins

When to keep components on server 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 can fetch data and render HTML before sending it to the browser, improving performance and SEO.
Click to reveal answer
beginner
Why keep components on the server in Next.js?
Keeping components on the server helps reduce JavaScript sent to the browser, speeds up page load, and improves SEO by rendering content before it reaches the user.
Click to reveal answer
intermediate
When should you NOT keep a component on the server?
If a component needs to handle user interactions like clicks or form inputs, it should be a client component because server components cannot handle browser events.
Click to reveal answer
intermediate
How do server components affect data fetching?
Server components can fetch data directly on the server without extra client requests, making data loading faster and simpler.
Click to reveal answer
beginner
What is a good real-life example to keep a component on the server?
A blog post list that shows many articles can be a server component because it only needs to display data and does not require user interaction.
Click to reveal answer
Which of these is a reason to keep a component on the server in Next.js?
ATo manage local component state
BTo handle button clicks in the browser
CTo add animations on the client side
DTo improve SEO by pre-rendering content
What happens if you try to use browser events in a server component?
AIt runs faster
BIt works normally
CIt causes an error or does not respond
DIt automatically converts to a client component
Which component type fetches data directly on the server in Next.js?
AServer component
BNeither
CBoth client and server components
DClient component
When should you choose a client component over a server component?
AWhen you want to improve SEO
BWhen you need user interaction like forms
CWhen you want faster server rendering
DWhen you want to reduce JavaScript size
What is a benefit of server components in Next.js?
AThey reduce JavaScript sent to the browser
BThey slow down page load
CThey increase JavaScript bundle size
DThey require client-side data fetching
Explain when and why you should keep components on the server in Next.js.
Think about performance and user interaction needs.
You got /4 concepts.
    Describe the difference between server and client components in Next.js with examples.
    Focus on where the code runs and what it can do.
    You got /6 concepts.