Server Component vs SSR
Answered
British Shorthair posted this in #help-forum
British ShorthairOP
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?
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?
Answered by Great golden digger wasp
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
25 Replies
Great golden digger wasp
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.
Hope so you understand. Still if you have any question you can ask.
@Great golden digger wasp 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.
British ShorthairOP
damn! man! you made it clear simply
Great golden digger wasp
My Pleasure
British ShorthairOP
So this means Server component can be used for SSR and SSG?
to achieve SSR or SSG, RSC is necessary
@Great golden digger wasp My Pleasure
British ShorthairOP
is it correct?
@British Shorthair So this means Server component can be used for SSR and SSG?
Great golden digger wasp
this is true
British ShorthairOP
ohh thanks 🙂
@British Shorthair to achieve SSR or SSG, RSC is necessary
Great golden digger wasp
No, React Server Components (RSC) are not necessary to achieve Server-Side Rendering (SSR) or Static Site Generation (SSG). While RSC can enhance these techniques, they are not a prerequisite.
British ShorthairOP
so SSR and SSG are goals
and RSC is a tool for those goals
and RSC is a tool for those goals
if you don't use RSC, how do you render react component on server
Great golden digger wasp
Bro without RSC, you can use next js, which render the entire page on the server for each request.
British ShorthairOP
but by default, every components are RSC
no?
that's why I: don't need to write 'use server' ?
@British Shorthair but by default, every components are RSC
Great golden digger wasp
yes
British ShorthairOP
then you use always RSC for server rendering
@British Shorthair then you use always RSC for server rendering
Great golden digger wasp
yes
bro there is a difference RSC and SSR.
British ShorthairOP
what's that my bro
Great golden digger wasp
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
Answer
Great golden digger wasp
Did you ever used next js
British ShorthairOP
ohh I see I understood what you meant 🙂
yes I am using Next.js uhhoo