Oct 2026 · Guide · ~8 min read
React Server Components vs Client Components — Part 2
By Safdar Ali — frontend engineer, Bengaluru
Part 1 is the decision: server by default, client on the leaf. Part 2 is what breaks after the team knows that rule and still ships a page that is secretly one large client component.
Pass server content as children
A client wrapper cannot import a Server Component. It can render one that was passed in as children, because the server already rendered that subtree.
// ClientShell.tsx
"use client";
export function ClientShell({ children }) {
const [open, setOpen] = useState(true);
if (!open) return null;
return <section>{children}</section>;
}
// page.tsx — still a Server Component
export default async function Page() {
const post = await getPost();
return (
<ClientShell>
<article>{post.title}</article>
</ClientShell>
);
}If you move the article into the client file to "keep it together," the fetch either becomes a client fetch or the whole page picks up the directive. That is the regression I review for.
Actions stay on the server
A client form can call a server action. The action is not a reason to mark the page as a client component. Validate on the server. The button's pending state is the client's job.
Three mistakes from the first refactor
- Putting the directive on the layout so one menu can use state.
- Importing a server-only module into a client file and then deleting the server fetch to make the build pass.
- Passing functions or class instances as props across the boundary. Pass data, or pass children.
Measure the client bundle after the split. A page that still downloads the whole tree did not get a boundary. It got a comment.
If this helped you
I publish free tutorials and write-ups like this in my spare time — no paywall on the guides. If it saved you an afternoon of trial and error, you can support the work:
- Buy me a coffee at buymeacoffee.com/safdarali
- Subscribe to my YouTube channel — it's free; 70+ React & Next.js tutorials
Related reading
More guides on safdarali.in — same author, production-focused.
- Guide
How to Build a Frontend Developer Portfolio That Stands Out
Frontend developer portfolio guide for India — sections, React/Next.js examples, SEO, performance, personal branding, FAQ, and checklist to build and rank.
May 2026Read article →
- Guide
React Server Components vs Client Components — When to Use Which
Practical RSC vs client guide for Next.js App Router — when to use each, real code, bundle before/after, and performance impact.
May 2026Read article →