React DOM

React's official renderer for the DOM and server — createRoot, hydrateRoot, and streaming SSR in one package.

Library
npm
v19.3.0
250,786 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
98 /100 Excellent
Development Activity 100
Maintenance 96
Community 96
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
86 /100 Excellent
Architecture 94
Code Quality 90
Innovation 88
Learning Curve 70

react-dom is the platform-specific renderer that pairs with the react package to turn React element trees into real DOM nodes in the browser or an HTML stream on the server. It exposes createRoot and hydrateRoot for client-side mounting and hydration, plus a family of server APIs — renderToPipeableStream, renderToReadableStream, and the legacy renderToString — for rendering React on Node, edge, and other JavaScript runtimes.

Maintained inside the same monorepo as react by the React core team at Meta, react-dom ships in lockstep with each React release and implements the reconciler’s host-config contract for the DOM: committing fiber updates to real elements, managing the synthetic event system, and handling hydration mismatches. Nearly every production React app — from bare Vite setups to Next.js and Remix — depends on it as the bridge between React’s virtual tree and the actual page.

What You Get

  • createRoot and hydrateRoot for mounting and hydrating client-side React trees
  • Streaming server-render APIs (renderToPipeableStream, renderToReadableStream) for Node, edge, and other runtimes
  • A synthetic event system that normalizes DOM events across browsers with delegated, pooled dispatch
  • Resource-hint APIs (preconnect, preload, preinit) for coordinating asset loading with rendering
  • Legacy renderToString/renderToStaticMarkup APIs for non-streaming SSR use cases

Common Use Cases

  • Mounting a client-rendered single-page React app into a DOM container
  • Hydrating server-rendered HTML on the client so React can attach event listeners without a full re-render
  • Streaming HTML from a Node or edge server as React components resolve, for fast time-to-first-byte SSR
  • Generating static HTML strings at build time for static site generators

Under The Hood

Architecture react-dom is the DOM-target implementation of React’s platform-agnostic renderer, split across two packages in the same monorepo: react-dom (the public entry points in index.js and client.js, re-exporting from src/client/ReactDOMClient.js and src/shared/ReactDOM.js) and react-dom-bindings (the DOM-specific implementation in src/client, src/events, and src/server). createRoot and hydrateRoot, defined in src/client/ReactDOMRoot.js, validate the target container via react-dom-bindings/src/client/ReactDOMContainer.js and hand off to react-reconciler, which drives the actual fiber-tree diffing and commit work — react-dom itself supplies the reconciler’s DOM ‘host config’ (how to create, update, and remove real nodes) rather than reimplementing diffing. Server rendering is a separate code path: ReactDOMFizzServerNode.js, ReactDOMFizzServerEdge.js, and per-runtime entry points like react-dom-server.node.js and react-dom-server.edge.js implement React’s Fizz streaming renderer, each producing a runtime-appropriate stream (Node Writable vs. Web ReadableStream) from the same component tree. Event handling is centralized in react-dom-bindings/src/events, which delegates listeners at the root and dispatches synthetic events through a plugin system rather than attaching handlers per DOM node.

Tech Stack The codebase is authored in Flow-typed JavaScript (flow-bin ^0.317.0) rather than TypeScript, compiled through a custom Babel pipeline (babel.config.js, babel.config-ts.js) and bundled per release channel with Rollup via scripts/rollup/build-all-release-channels.js. It’s a Yarn workspace monorepo (packages/*) with react-dom as one of dozens of interdependent packages (react, react-reconciler, react-dom-bindings, scheduler); react-dom’s only runtime dependency is scheduler, with react itself required as a matching peerDependency. Tests run on Jest 29, and the repo additionally builds an experimental Rust-based React Compiler (the top-level compiler/ directory) that ships as a separate package rather than being part of react-dom directly.

Code Quality Testing is extensive and colocated: over 130 -test.js files sit alongside implementation files across src/client, src/events, src/server, and src/test-utils, covering hydration mismatches, event delegation, and streaming edge cases with React’s internal fixture-based test harness. Code favors small, single-purpose modules (ReactDOMRoot.js, for example, is 380 lines and handles only root creation/options, not rendering itself) with Flow type annotations on public option objects (CreateRootOptions, HydrateRootOptions) documenting every callback’s error/error-info shape. Naming is consistent and DOM-specific (ReactDOM prefix throughout), and feature flags (shared/ReactFeatureFlags, e.g. disableCommentsAsDOMContainers) gate experimental behavior instead of branching on ad hoc conditionals, keeping stable code paths readable.

API Design The public surface is deliberately small and split by concern: react-dom/client for browser mounting (createRoot, hydrateRoot), react-dom/server (and its runtime-specific siblings server.node, server.edge, server.browser) for SSR, and root-level exports like createPortal, flushSync, and the preload/preinit/preconnect resource hints. This subpath-based export design, driven by package.json ‘exports’ conditions keyed on react-server/workerd/bun/node/edge-light, lets bundlers pull in only the runtime-appropriate implementation without dead code — unusually sophisticated for an npm package’s exports map. Getting started requires minimal boilerplate, just one createRoot() call and one .render(), though the breadth of server APIs (five different render-to-stream variants) means picking the right one for your deployment target is the main learning cost, offset by consistent naming and centralized docs at react.dev/reference/react-dom.

Used by 453 apps in this directory

Ruby
59%
AGPL 3.0

Mastodon

Social Media

50,335

Run your own federated social network on the open ActivityPub standard with no ads, no algorithms, and no corporate control over your community.

View details
95
Repo Health
81
Technical
70
Dependency
Built with
Ruby 59%
TypeScript 24%
Updated 1 weeks ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

28,378

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
90
Repo Health
73
Technical
65
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago
TypeScript
51%
Other

Mattermost

Collaboration · Devops · Team Chat

39,203

Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.

View details
96
Repo Health
87
Technical
65
Dependency
Built with
TypeScript 51%
Go 40%
Updated 1 weeks ago
TypeScript
51%
Other

Mattermost

Collaboration · Devops · Team Chat

39,203

Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.

View details
96
Repo Health
87
Technical
65
Dependency
Built with
TypeScript 51%
Go 40%
Updated 1 weeks ago
TypeScript
88%
Apache 2.0

Medplum

Authentication · Databases · Developer Tools

2,709

An open-source, FHIR-native healthcare platform that gives developers a compliant backend, authentication, a React component library, and serverless bots to build clinical applications in weeks instead of years.

View details
93
Repo Health
90
Technical
72
Dependency
Built with
TypeScript 88%
Updated 1 weeks ago
TypeScript
88%
MIT

medusa

Ecommerce

36,494

The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.

View details
93
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 88%
JavaScript 12%
Updated 2 weeks ago
Rust
48%
MIT

Meetily

AI Assistants · Productivity

31,171

Privacy-first AI meeting assistant that transcribes and summarizes your meetings entirely on your local machine — no cloud, no data leakage.

View details
85
Repo Health
72
Technical
67
Dependency
Built with
Rust 48%
TypeScript 29%
Updated 3 weeks ago
TypeScript
95%
MIT

melty

AI Code Assistants · Code Editors · Developer Tools

5,444

The AI code editor where every chat message is a git commit you can revert, branch, or squash

View details
35
Repo Health
75
Technical
67
Dependency
Built with
TypeScript 95%
Updated 1 years ago
Go
51%
MIT

memos

Note Taking

63,382

Open-source, self-hosted note-taking built for quick capture — Markdown-native, lightweight, and fully yours.

View details
91
Repo Health
78
Technical
65
Dependency
Built with
Go 51%
TypeScript 48%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers