RSC vs Client Components — when do you add 'use client' in Next.js 15?
853 views
01
01
Understand the problem
Question presented to candidate:
"How do you decide which components get "use client"?"
What a strong answer should cover:
The default in the App Router is a Server Component. "use client" is an opt out, not an opt in — you add it only when you need something the server cannot do.
The trigger list is short and concrete: state, effects, event handlers, browser APIs, refs to DOM nodes, and any hook that depends on those.
It is an import-graph boundary, not a per-file label. Everything a Client Component imports — transitively — joins the client bundle. That is why placement matters so much.
So the rule is push it down to the leaves. A "use client" near the root converts the whole tree and you keep all the constraints while losing the benefit.
The composition escape hatch: a Client Component can receive Server Components as children. The parent being client does not force its children to be.
Props crossing the boundary must be serialisable — no functions, no class instances.
Practical smell test: if a component only formats and displays data, it should be a Server Component; if it responds to the user, it is a leaf that needs the directive.
Clarifying questions expected:
"Does this component actually need interactivity, or does only a small part of it?" — that decides where the boundary goes.
"What does this file import?" — a heavy library pulled in by a client component ships too.
Code / implementation expected: Optional. Showing a component split into a server shell and a client leaf is the substance.
rscnextjsserver-components
02
02
Attempt it yourself
Sketch your approach before reading the solution — that's what interviews test.
Nudge consolestandby
Stuck? Beam a request up — the console returns a conceptual nudge that guides your logic without spoiling the implementation.
03
03
Study the solution
Target Audience: Engineers preparing for Next.js interviews — assumes what Server Components are.
Difficulty: Medium
How to read this doc: Concepts are explained in plain language first, then tagged with 📌 Interview
Solution ready — 2 min read
Classified // press E to declassify
04
04
Explore the playground snippets
The same page split badly and well, with what ships in each case