#Server Component vs SSR

27 messages · Page 1 of 1 (latest)

robust ibex
#

I think I am confused between Server component and SSR.
I thought Server Component is a component that is rendered on Server side then become HTML code on the server then sent to client side.
But It seems Server Component is a term for "only non-interactive components in a file".
Can you help me understanding this clearly?

willow lilyBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

mental depot
#

Bro SSR involves rendering the complete page on the server and dynamic content can be rendered per request. And server components are static components that render on the server and ideal for static content that doesn't need client-side interactivity.
Hope so you understand. Still if you have any question you can ask.

robust ibex
mental depot
#

My Pleasure

robust ibex
#

So this means Server component can be used for SSR and SSG?

#

to achieve SSR or SSG, RSC is necessary

robust ibex
robust ibex
#

ohh thanks 🙂

mental depot
robust ibex
#

so SSR and SSG are goals
and RSC is a tool for those goals

robust ibex
#

if you don't use RSC, how do you render react component on server

mental depot
#

Bro without RSC, you can use next js, which render the entire page on the server for each request.

robust ibex
#

but by default, every components are RSC

#

no?

#

that's why I: don't need to write 'use server' ?

mental depot
robust ibex
#

then you use always RSC for server rendering

mental depot
#

bro there is a difference RSC and SSR.

robust ibex
#

what's that my bro

mental depot
#

Bro first RSC and completly static means no interativity and SSR renders the initial HTML on the server and sends it to the client. This helps with faster initial load times and better SEO. After the HTML is sent to the client, the React JavaScript bundle is also sent, and React takes over to make the page interactive. This process is known as hydration

#

Did you ever used next js

robust ibex
#

ohh I see I understood what you meant 🙂

#

yes I am using Next.js uhhoo