React and ReactDOM are two separate packages. react contains the core library: components, hooks, elements and the logic that describes your UI. react-dom is the renderer that takes that description and puts real elements into the browser page. This react vs react dom split is why one app imports from both react and react-dom/client.
React itself knows nothing about browsers. That separation lets the same React code drive the web (ReactDOM), phones (React Native) and other targets, each with its own renderer.
The react package is platform independent. It gives you the tools to describe a UI:
useState, useEffect, useRef, useContext and the other hookscreateElement (what JSX compiles to, through the JSX runtime)Fragment, Suspense, StrictMode, memo, lazycreateContext and, in React 19, use and the Actions hooksNone of these touch the page. They produce a tree of plain JavaScript objects called React elements, plus bookkeeping about state and effects.
This component works the same whether it is drawn in a browser, on a phone or rendered to a string on a server, because it only uses react.
react-dom connects React to the browser DOM. The parts you use most are:
| Import | Purpose |
|---|---|
react-dom/client | createRoot and hydrateRoot to start an app in the browser |
react-dom | createPortal, flushSync and resource hints such as preload |
react-dom/server | renderToString, renderToPipeableStream and similar for server rendering |
The entry point of a modern app looks like this:
Here StrictMode comes from react, while createRoot comes from react-dom/client. The HTML page needs a matching element:
createRoot takes that real DOM node, and .render() tells React to draw the App element tree inside it.
When state changes, the work splits into two phases:
<li>.The reconciler is bundled with the renderer, which is why you install react and react-dom at the same version. Keep their versions equal in package.json:
Mismatched versions can cause runtime errors that are hard to read.
Older tutorials use code from before React 18. The table shows what changed and what happened in React 19.
| Old code | Status | Use instead |
|---|---|---|
ReactDOM.render(<App />, node) | Removed in React 19 | createRoot(node).render(<App />) |
ReactDOM.hydrate(...) | Removed in React 19 | hydrateRoot(node, <App />) |
ReactDOM.unmountComponentAtNode(node) | Removed in React 19 | root.unmount() |
import ReactDOM from "react-dom" for the root | Old import path | import { createRoot } from "react-dom/client" |
ReactDOM.findDOMNode | Removed in React 19 | A ref |
If you copy an old snippet and see "ReactDOM.render is not a function" on React 19, this is the reason.
Because react is renderer neutral, other projects supply their own renderer package:
react-three-fiber renders to a 3D scene.ink renders to a terminal.react-pdf renders to PDF documents.In all of them you write components with the same react hooks and JSX. Only the primitives differ: <div> and <button> in the DOM, <View> and <Text> in React Native.
Yes, for a client-rendered React web app you need react and react-dom. Frameworks such as Next.js or React Router install and use them for you, but they are still in the dependency list.
JSX only builds elements, which is the job of react. Putting those elements in the page is the renderer's job, and that happens once at the entry file.
You can use it with a different renderer, for example React Native or a custom renderer. For a browser DOM app you cannot.
createRoot and hydrateRoot?createRoot renders a fresh tree into an empty node. hydrateRoot attaches React to HTML that the server already produced, so event handlers start working without rebuilding the page.
react describes what the UI should be: components, hooks and elements. react-dom makes it real in the browser through createRoot, portals and server rendering helpers. Keep both at the same version, use react-dom/client for the entry point, and replace the removed ReactDOM.render with createRoot.