Question presented to candidate:
"You have got react and react-dom in your package.json. What is the difference — why are they two separate packages, and what does react-dom actually do?"
What a strong answer should cover:
reactis the platform-agnostic core: components, Hooks, and reconciliation. It has no idea what a<div>is.react-domis the renderer that applies React's output to a real browser DOM.- The three entry points:
react-dom/client(createRoot / hydrateRoot),react-dom/server(renderToString and the streaming APIs), and the top-levelreact-domutilities. - Why the split exists: the same component code can target other renderers — React Native, react-three-fiber, react-pdf.
ReactDOM.render,ReactDOM.hydrate, andReactDOM.findDOMNodewere deprecated in React 18 and removed in React 19.- Bonus signal:
useFormStatusships fromreact-dom, notreact— a detail most candidates get backwards.
Clarifying questions expected:
- "Which React version are we targeting?" — the answer changes for 19 vs. 17.
- "Do you want the client story, the server story, or both?"
Code / implementation expected: Optional. A short createPortal snippet is the strongest concrete demonstration of a react-dom-specific capability.