Next.js Discord

Discord Forum

Should we use server components in state-less components?

Unanswered
Black Vulture posted this in #help-forum
Open in Discord
Black VultureOP
Should we use server components by default unless the component wants to have a state?
I asked this because I saw the server components are a bit slow at the initial load even though there isn't any API call or something heavy inside them.

13 Replies

Its best to use client component inside server component imo
You can create another file like if you're dividing it into sections like /route/component/introduction.tsx
and use client components there
Black VultureOP
as the cases are mostly a page you mean keeping pages as server components no matter what and narrow components into client components?
is there any benefit in having server components when there is no API call?
Black VultureOP
and in the dashboard?
What are you referring by "dashboard", like which dashboard
Black VultureOP
I mean where SEO optimization doesn't matter
also we had SSR with states before server components 🤔
... For dashboard, you'll need server component
for like getting data
Black VultureOP
I just checked the client components have SSR too
If thats the case, there are some other advantages also