facebook/react
React
React is a JavaScript library for building user interfaces. This repository (facebook/react) is the canonical home of the React project: the core library, the various platform renderers (DOM, Native, Test, Art, Noop), the experimental React Server Components stack, the React DevTools browser extension, the React Compiler, and the supporting build, release, and lint tooling.
What this repository contains
The repo is a Yarn 1 monorepo with two top-level workspaces:
- The React runtime, everything outside
compiler/. Each public npm package lives underpackages/<name>(e.g.packages/react,packages/react-dom,packages/react-reconciler). - The React Compiler, everything under
compiler/. It has its own Yarn workspaces, build pipeline, and tests, and ships separate npm packages such asbabel-plugin-react-compilerandeslint-plugin-react-compiler.
Beyond the published packages, the repo also includes:
- A heavily customized Rollup-based build system at
scripts/rollup/that produces dozens of bundle variants (development, production, profiling, FB-internal, ESM, CJS, server, react-server, etc.) per release channel (stable, experimental, www-modern, www-classic). - A Jest harness under
scripts/jest/that wires up release-channel-aware test runs and a feature-flag gating system inscripts/jest/setupTests.js. - Custom ESLint plugins under
scripts/eslint-rules/that enforce React-internal invariants (e.g. invariant message extraction, no-cross-package-imports). - An error-code extractor (
scripts/error-codes/) that minifies production warnings/errors into numeric codes redirected throughreact.dev/errors. - A Danger script (
dangerfile.js) that posts a bundle-size table to every PR.
Audience
This wiki is written for engineers working in the React monorepo: people fixing reconciler bugs, adding renderer host-config methods, writing new compiler passes, shipping flags through release channels, or maintaining the DevTools browser extension. It assumes familiarity with React's public API; it does not re-explain hooks, JSX, or component lifecycles. For end-user docs, see react.dev.
Map of the codebase
facebook/react
├── packages/ # npm-published runtime packages (40+)
│ ├── react/ # core: createElement, hooks dispatcher, JSX runtime
│ ├── react-dom/ # DOM client + SSR + bindings entry
│ ├── react-dom-bindings/ # internal DOM-specific reconciler config
│ ├── react-reconciler/ # the fiber engine (renderer-agnostic)
│ ├── scheduler/ # cooperative task scheduler (the "MessageChannel" loop)
│ ├── react-server/ # Flight server core (RSC payload writer)
│ ├── react-server-dom-{webpack,parcel,turbopack,esm,...}/ # bundler-specific Flight clients
│ ├── react-native-renderer/ # bridge to React Native / Fabric
│ ├── react-noop-renderer/ # in-memory renderer used for reconciler tests
│ ├── react-art/ # Canvas/SVG/VML renderer via the ART library
│ ├── react-test-renderer/ # tree → JSON renderer
│ ├── react-devtools*/ # browser extension, standalone app, shared core
│ ├── react-refresh/ # fast-refresh runtime
│ ├── eslint-plugin-react-hooks/
│ ├── shared/ # cross-package internals (feature flags, ReactSymbols)
│ └── ... (use-sync-external-store, react-cache, react-is, etc.)
├── compiler/ # React Compiler (separate workspace)
│ ├── packages/babel-plugin-react-compiler/ # the actual compiler
│ ├── packages/eslint-plugin-react-compiler/ # rules-of-react lints
│ ├── packages/react-compiler-runtime/ # `react/compiler-runtime` shim
│ └── apps/playground/ # Next.js playground at playground.react.dev
├── scripts/ # Rollup, Jest, lint, release, error codes, flags
├── fixtures/ # standalone apps for manual smoke-testing builds
├── .github/workflows/ # CI: build+test, prereleases, devtools regressions, lint
└── ReactVersions.js # source of truth for per-package versionsQuick links
- Architecture — release channels, fiber lifecycle, reconciler ↔ renderer boundary, Flight pipeline.
- Getting started — what to install, how to build, how to run tests.
- Glossary — fiber, lane, root, host config, react-server, www-classic, and friends.
- Packages overview — guided tour of every published package.
- Compiler overview — the new auto-memoizing compiler in
compiler/. - How to contribute — workflow, tests, debugging, conventions.
A note on scope
React is one of the larger and longer-lived JavaScript projects on GitHub: the repo's first commit is from May 2013, and it has accumulated more than 21,000 commits and ~1,970 distinct authors. This wiki does not try to document every package, file, or feature flag. It focuses on the parts that show up most often in day-to-day work on the runtime and the compiler, and links to specific source files (with full repo-root paths) so you can jump into the code in one click.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.
Next
Architecture