facebook/react
Fun facts
Light trivia mined from git log, git blame, and a few hours staring at packages/.
The oldest line of code still in production
Files like packages/react/src/ReactBaseClasses.js (the Component / PureComponent definitions) and packages/react/src/ReactChildren.js (Children.map/forEach) trace back to the very first weeks of the open-source release in May–June 2013. They have been edited for style and for a handful of correctness fixes, but the shape and most of the code is unchanged after 12+ years.
packages/shared/ReactSymbols.js started life with five symbols (REACT_ELEMENT_TYPE, REACT_PORTAL_TYPE, REACT_FRAGMENT_TYPE, REACT_STRICT_MODE_TYPE, REACT_PROVIDER_TYPE). It now defines symbols for Activity, View Transition, Server Components, the Tracing Marker — but every original symbol is still there, and REACT_ELEMENT_TYPE is the most-imported single named export in the entire repository.
A "renderer" that doesn't render anything
packages/react-noop-renderer/ is exactly what it sounds like: a renderer whose host instances are plain JavaScript objects that get appended to in-memory arrays. It exists almost exclusively to test the reconciler in isolation — without DOM, without React Native, and with the ability to single-step the work loop from a test.
Most React reconciler bug fixes ship with a regression test written against react-noop-renderer, not react-dom.
The www channel exists because Facebook predates open-source React
The release channel system has variants like www-classic and www-modern. www is Facebook's internal monorepo. React was first written for www and only later open-sourced. Some Facebook product code still uses class components and the legacy synchronous mode (www-classic), while newer Facebook product code uses concurrent rendering (www-modern). The fork files in packages/shared/forks/ReactFeatureFlags.www-*.js are how a single source tree services both worlds.
"Forget" became "Compiler"
The auto-memoizing compiler was internally called React Forget for years (because you could forget to use useMemo/useCallback and it would still be fast). It was renamed to the more boring React Compiler when it was made public. A handful of identifiers and comments still reference "Forget" — compiler/packages/react-forgive/ is the VS Code extension and is one of the few places the original name survives in the file tree.
React's Lane scheduler is a 31-bit number
packages/react-reconciler/src/ReactFiberLane.js defines about 30 distinct lanes — SyncLane, InputContinuousLane, DefaultLane, TransitionLane1 through TransitionLane14, several RetryLanes, IdleLane, OffscreenLane, DeferredLane, GestureLane. Each occupies a single bit; LaneSets are 31-bit bitmasks. The bitmask layout is hand-crafted so that "highest priority lane" is lanes & -lanes (an isolate-lowest-bit trick that exploits two's-complement arithmetic).
The largest single file is bigger than most React apps
packages/react-reconciler/src/ReactFiberWorkLoop.js is roughly 5,100 lines as of this snapshot. ReactFiberCommitWork.js is right behind at ~5,000. Together those two files plus ReactFiberHooks.js and ReactFiberBeginWork.js make up more lines than react, react-dom, scheduler, and react-test-renderer combined. The reconciler is genuinely where the work happens.
The "MessageChannel hack"
The scheduler uses MessageChannel to schedule continuations in a way that yields to the browser between tasks but isn't subject to the 4ms setTimeout clamp. The choice has aged well — postTask, when it shipped, was a near-drop-in replacement, but the MessageChannel fallback is still there because not every environment has postTask yet (Safari shipped it last). The whole mechanism is in packages/scheduler/src/forks/SchedulerFeatureFlags.js and the platform-specific entry files in packages/scheduler/src/.
There are nine renderers in the tree
packages/ ships nine distinct renderers that all share one reconciler:
react-dom(browser DOM)react-native-renderer(Fabric only after April 2026)react-art(Canvas/SVG/VML via the ART library)react-test-renderer(tree → JSON)react-noop-renderer(in-memory objects)react-server-dom-webpack(Flight client/server pair for webpack)react-server-dom-parcelreact-server-dom-turbopackreact-server-dom-esmandreact-server-dom-unbundled(and-fb)
Plus a streaming HTML renderer (react-server/Fizz) which uses a different architecture (it renders straight to a stream rather than committing to a host).
React was originally not on GitHub
The first GitHub history starts in 2013, but React the project predates that — it was developed inside Facebook's internal repo for over a year before the open-source push. That's why so many files have a 2013 copyright header that pre-dates their first git commit.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.
Previous
Lore
Next
How to contribute