React 19.x: Actions, forms and Server Components · senior
Server Components, Server Functions and the directives
Server Components run only on the server (at build or request time), can be async and read data directly, and send no JavaScript; "use client" marks the module boundary where client code starts, and "use server" marks Server Functions that the client can call over the network.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- There is no directive for Server Components: in an RSC framework, components are Server Components by default.
"use client"at the top of a file makes that module and everything it imports part of the client bundle. Put it on leaf interactive components, not whole pages."use server"marks Server Functions (called Server Actions when used for mutations/forms). It is NOT how you make a Server Component.- A Client Component cannot import a Server Component, but it can receive one as
childrenor another prop (the server renders it and sends the result). - Props crossing the boundary must be serializable: primitives, plain objects, arrays, Date, Map, Set, promises, JSX, and Server Function references. Not class instances or normal functions.
- The RSC payload is a serialized tree: rendered Server Component output, placeholders and JS references for Client Components, and their props. It is used for navigation and to reconcile with client state.
- Server Functions are public HTTP endpoints: validate input, check auth and authorisation inside each one.
- Security: CVE-2025-55182 ("React2Shell", Dec 2025) was a remote-code-execution flaw in how React decoded Server Function payloads; apps supporting RSC were vulnerable even without their own Server Functions. Fixed in 19.0.1/19.1.2/19.2.1; frameworks like Next.js, React Router and Waku shipped patches. The bundler APIs behind RSC do not follow semver between 19.x minors, so frameworks pin exact React versions.
The red pen
Common traps: mistake → fix
Mistake: "
use servermakes a Server Component"Fix: it marks Server Functions.
Mistake: "Server Components can't be used with interactivity, so make the whole page client"
Fix: push
"use client"down to the interactive leaf.Mistake: "Server Components are the same as SSR"
Fix: SSR produces HTML; RSC produces a component payload and can run without SSR. Client Components are still server-rendered to HTML on first load.
Mistake: "A Server Function is private because it is not in an /api folder"
Fix: anyone can POST to it.
Easy to hard
Questions interviewers ask, easy to hard
- What is a React Server Component?
- What do
"use client"and"use server"mean? Is"use server"how you mark a Server Component? - What can and cannot cross the server/client boundary?
- Can a Client Component render a Server Component?
- What did React2Shell teach about the RSC protocol and patching?
Practise
Practise with these questions
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.