explain this in SSR
Unanswered
piscopancer posted this in #help-forum
I have a homepage which I tried running both with and without
'use client' declaration. To my surprise, the retrieved HTML did not change in both scenarios. I expected that by turning a homepage into a client component it will not generate absolutely any html contained in it, but it did. So what's the reason for not using 'use client'? I don't get it11 Replies
"Client Components enable you to add client-side interactivity to your application. In Next.js, they are pre-rendered on the server and hydrated on the client. You can think of Client Components as how components in the Pages Router have always worked."
@European sprat https://nextjs.org/docs/getting-started/react-essentials#client-components
that makes sense, I am aware client component allow hydration. I just do not udnerstand why not using them all the time? What's the advantage of a component that does not use 'use client' directive. Do you know the answer?
European sprat
You can interact with your database and other server related stuff directly in the server component
The page I linked talks about why and when to use server or client components
ok I am reading that
this thread from yesterday could also help - https://nextjs-forum.com/post/1133359010494554112
if my whole project is CSR, search bots will still be able to find the contents on it, impressive
goddamn good