Next.js Discord

Discord Forum

Which parts are client side and which are server sided

Unanswered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
If I use a 'use client' component in a normal/server rendered page will only the 'use client' component be rendered on the client side while the rest of the page remains server-rendered?

6 Replies

Eurasian Blackbird
yep
you can combine them in more ways than just using client components inside server pages - you can pass server jsx as props to client components too, which means you can use client components as context providers and lots of other patterns
"use client" doesn't prevent you from running server side code.
and "use server" is not the opposite of "use client" hence does not force any component on becoming a server component