Concurrent React and Suspense · senior
Server rendering, streaming and hydration
Server rendering sends HTML so users see content early; hydration then runs the components again in the browser and attaches event handlers to that HTML, which only works if the client's first render produces exactly the same output as the server.
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
- APIs:
renderToPipeableStream(Node) /renderToReadableStream(Web Streams) on the server;hydrateRoot(container, <App />)on the client.prerender/resume(React 19.2) power Partial Prerendering. - Streaming: with Suspense, React sends the shell first and streams each boundary's HTML later in the same response.
- Selective hydration: boundaries hydrate independently, and React hydrates the part the user interacts with first.
- Hydration mismatch causes: dates and time zones (server UTC vs browser IST),
Math.random()/Date.now(),typeof windowbranches,localStorage-based UI, invalid HTML nesting (<div>inside<p>), browser extensions. - Fixes: deterministic output (explicit time zone and locale), stable ids with
useId, client-only parts rendered after hydration,suppressHydrationWarningonly for one intentional text difference (like a timestamp). - React 19.3
use(browser())(fromreact-dom): suspends on the server so the fallback goes into the HTML, then renders on the client after hydration; it replacesmountedflags andtypeof windowchecks. - React 19 shows one error with a diff for mismatches and skips unexpected tags injected into
<head>/<body>by extensions. - Hydration costs JavaScript and CPU; Server Components reduce what must hydrate.
The red pen
Common traps: mistake → fix
Mistake: "SSR means no JavaScript on the client"
Fix: the client still downloads JS and hydrates.
Mistake: "
typeof window !== "undefined"in render is the fix for client-only code"Fix: it causes mismatches; render client-only parts after hydration or use
browser().Mistake: "suppressHydrationWarning everywhere"
Fix: it hides real bugs and only works one level deep.
Easy to hard
Questions interviewers ask, easy to hard
- What is hydration and what does it cost?
- If HTML is rendered on the server, how does JavaScript work afterwards?
- We get a hydration mismatch on a component that formats dates. First hypothesis? Other causes?
- How do streaming and selective hydration work together?
- How do you render a component that reads localStorage without a mismatch in React 19.3?
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.