This document introduces the facebook/react monorepo, its package structure, and how the major subsystems relate to each other. For a complete per-package breakdown including inter-dependencies and workspace setup, see Repository Structure and Packages. For the feature flag system specifically, see Feature Flags (§2). For the React Compiler, see React Compiler (§9).
The repository (current release 19.3.0, packages/shared/ReactVersion.js15) ships:
react public API package and react-dom browser rendererreact-reconciler) and cooperative task scheduler (scheduler)babel-plugin-react-compiler) for automatic memoizationThe root is a Yarn 1 workspace monorepo (package.json2-5). All publishable packages live under packages/. The React Compiler lives in a separate nested Yarn workspace at compiler/.
/
├── packages/ # All npm packages (react, react-dom, scheduler, etc.)
├── compiler/ # React Compiler packages (separate Yarn workspace root)
├── scripts/
│ ├── rollup/ # Build pipeline (build.js, bundles.js, use-forks-plugin.js)
│ ├── jest/ # Test runner (jest-cli.js, per-channel jest.config.js)
│ ├── flow/ # Flow config generator (createFlowConfigs.js)
│ ├── release/ # Release automation scripts
│ ├── eslint-rules/ # Internal ESLint plugin (react-internal)
│ └── shared/ # Build helpers (inlinedHostConfigs.js, pathsByLanguageVersion.js)
└── fixtures/ # Manual integration test fixtures
Sources: package.json2-5 scripts/flow/createFlowConfigs.js14-16
| Package | Version | Purpose |
|---|---|---|
react | 19.3.0 | Public React API: hooks, component base classes, element creation, JSX runtime |
react-dom | 19.3.0 | DOM renderer (client + server); also contains Fizz streaming SSR |
react-reconciler | 0.34.0 | Fiber reconciler with pluggable host config; public custom-renderer API |
scheduler | 0.28.0 | Cooperative task scheduling via message-channel-based work loop |
react-is | 19.3.0 | Runtime brand-checking utilities (isFragment, isPortal, isMemo, etc.) |
Sources: packages/react/package.json packages/react-dom/package.json packages/react-reconciler/package.json packages/scheduler/package.json packages/react-is/package.json
| Package | Purpose |
|---|---|
react-native-renderer | React Native: legacy Paper renderer and concurrent Fabric renderer |
react-art | Vector graphics renderer targeting Canvas, SVG, and VML via the ART library |
react-test-renderer | In-process renderer for snapshot testing (no DOM dependency) |
react-noop-renderer | No-op renderer used in reconciler unit tests |
Sources: packages/react-test-renderer/package.json packages/react-art/package.json
| Package | SSR System | Purpose |
|---|---|---|
react-dom/server | Fizz | Streaming HTML rendering; node, edge, browser, and bun variants |
react-server-dom-webpack | Flight | React Server Components integration for Webpack |
react-server-dom-turbopack | Flight | React Server Components integration for Turbopack |
react-server-dom-parcel | Flight | React Server Components integration for Parcel |
react-server-dom-esm | Flight | React Server Components integration for native ESM |
react-server-dom-fb | Flight | React Server Components (Facebook-internal build) |
react-server-dom-unbundled | Flight | React Server Components without a bundler |
| Package | Version | Purpose |
|---|---|---|
react-devtools-shared | — | DevTools backend (fiber inspection) and frontend UI core |
react-devtools-extensions | — | Browser extensions for Chrome, Firefox, and Edge |
react-devtools-timeline | — | Profiler timeline visualizer |
react-debug-tools | — | Hooks inspection API consumed by DevTools |
react-refresh | — | Hot Module Replacement integration |
eslint-plugin-react-hooks | 7.0.0 | rules-of-hooks and exhaustive-deps ESLint rules |
jest-react | 0.17.0 | Jest matchers for React component testing |
internal-test-utils | — | Shared test helpers (act, gate, waitFor, etc.) |
dom-event-testing-library | — | DOM event simulation helpers used in tests |
Sources: packages/jest-react/package.json packages/eslint-plugin-react-hooks/package.json .eslintrc.js325-345
compiler/)| Package | Purpose |
|---|---|
babel-plugin-react-compiler | Babel transform for automatic component memoization |
eslint-plugin-react-compiler | IDE/CI diagnostics based on compiler analysis |
react-compiler-runtime | Runtime library for compiled output (useMemoCache) |
react-compiler-healthcheck | Scans codebases for patterns incompatible with the compiler |
react-mcp-server | MCP server for compiler documentation queries |
packages/shared/ provides utilities consumed across all packages during the build; it is not published on npm as a separate package.
| File | Purpose |
|---|---|
ReactSymbols.js | Symbol.for(...) constants identifying React element types |
ReactVersion.js | Current version string ('19.3.0') |
ReactFeatureFlags.js | Feature flag definitions, forked per build target |
Sources: packages/shared/ReactSymbols.js1-65 packages/shared/ReactVersion.js1-15
The diagram below maps the major subsystems to their key source files. Solid arrows indicate runtime or compile-time dependencies. Dashed arrows indicate tooling relationships (linting, inspection, transformation).
Diagram: Runtime Package Dependency Graph
Sources: packages/react/src/ReactClient.js packages/shared/ReactSymbols.js scripts/flow/createFlowConfigs.js86-91
The react-reconciler package is renderer-agnostic. It imports from the abstract module react-reconciler/src/ReactFiberConfig, which is substituted at build time — via Rollup's use-forks-plugin — with a renderer-specific implementation. This pattern lets the same reconciler drive DOM, Native, ART, test, and custom environments.
Diagram: ReactFiberConfig Module Fork Resolution
Sources: scripts/flow/createFlowConfigs.js86-91
The fork resolution logic is driven by scripts/shared/inlinedHostConfigs.js, and the per-renderer Flow type configs are generated by scripts/flow/createFlowConfigs.js. For a deeper explanation of this mechanism, see Host Configuration Abstraction (§4.6).
The react package uses the Node.js exports field to expose different module subsets depending on the execution environment.
| Import Path | Condition | Source File |
|---|---|---|
react | default (client) | packages/react/src/ReactClient.js |
react | react-server | packages/react/src/ReactServer.js |
react/jsx-runtime | default | JSX transform runtime |
react/jsx-runtime | react-server | Server JSX runtime |
react/compiler-runtime | any | ReactCompilerRuntime (useMemoCache) |
The client entry (packages/react/src/ReactClient.js76-137) exports all hooks, component types (Fragment, Suspense, StrictMode, Profiler, etc.), and utilities. The server entry (packages/react/src/ReactServer.js43-67) exports a restricted subset: no client-only hooks (useState, useEffect, useReducer, etc.), but includes use, cache, cacheSignal, and server-safe utilities.
These entry points are wired up in packages/react/package.json24-43 and the top-level re-export file packages/react/index.js24-74
For full detail on the React API surface and the client vs. server split, see Core React API (§3) and Public API and Built-in Types (§3.1).
Several files affect all packages regardless of which renderer or channel is being built:
packages/shared/ReactSymbols.js — Defines Symbol.for(...) constants such as REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, REACT_SUSPENSE_TYPE, and REACT_MEMO_TYPE. These symbols are used by the reconciler, renderers, Fizz, Flight, and DevTools to identify element types at runtime. See Core API (§3).
packages/shared/ReactFeatureFlags.js — The central feature flag file. It is forked per build target (www, native-fb, native-oss, test-renderer) to enable or disable concurrent features and experimental APIs per deployment context. See Feature Flags (§2).
packages/shared/ReactVersion.js — Single source of truth for the React version string during the build. See Release Channels and Versioning (§7.2).
Sources: packages/shared/ReactSymbols.js1-65 packages/shared/ReactVersion.js1-15
| Tool | Role | Key Entry Point |
|---|---|---|
| Rollup | Package bundler and module forking | scripts/rollup/build.js, scripts/rollup/bundles.js |
| Flow | Static type checking | scripts/flow/config/flowconfig, scripts/flow/environment.js |
| Jest | Multi-channel, multi-renderer test runner | scripts/jest/jest-cli.js |
| ESLint | Linting (includes react-internal custom rules) | .eslintrc.js, scripts/eslint-rules/ |
| Prettier | Code formatting | scripts/prettier/index.js |
| Yarn 1 | Workspace and dependency management | package.json |
For build pipeline details (Rollup configuration, module forking, bundle types), see Build Pipeline and Module Forking (§7.1). For release channels (stable, canary, experimental) and CI/CD, see Release Channels (§7.2) and CI/CD (§7.3).
Sources: package.json124-157 .eslintrc.js1-33 scripts/flow/config/flowconfig1-44 scripts/flow/environment.js1-30
Refresh this wiki
This wiki was recently refreshed. Please wait 7 days to refresh again.