React Native Internals & the New Architecture
How React Native actually runs: the Hermes engine, JSI, the Fabric renderer, TurboModules, and what they mean for performance.
Advanced · about 4 hours · difficulty 4/5
Learn first: Hooks, Effects & Platform-specific Code
You can build many apps without knowing the internals, but performance debugging and native integration get much easier once you do.
The moving parts
- Hermes: the JavaScript engine optimised for React Native. It precompiles JS to bytecode, which improves startup time and memory use.
- JSI (JavaScript Interface): lets JavaScript hold direct references to C++ objects and call them synchronously, replacing the old asynchronous JSON "bridge".
- Fabric: the renderer. React computes a tree of changes, and Fabric applies it to native views, supporting concurrent React features.
- TurboModules: lazily loaded native modules accessed through JSI.
- Codegen: generates type-safe native glue from TypeScript specs.
Threads
Roughly, there is a JS thread running your React code, a UI (main) thread drawing native views, and background threads for layout (Yoga) and other work. A busy JS thread makes taps and JS-driven animations lag even though native scrolling still works.
Why it matters
- Libraries must support the New Architecture; check compatibility before adding one.
- Animations that run on the UI thread (Reanimated worklets) stay smooth when the JS thread is busy.
Good enough to move on: you can explain why a heavy loop in a button handler freezes JS animations but not native scrolling.
Key concepts
- Hermes engine
- JSI and the end of the bridge
- Fabric renderer
- TurboModules and Codegen
- JS thread vs UI thread
- Checking library compatibility
Mini project
Build a demo screen with a button that blocks the JS thread for two seconds, and compare a JS-driven animation with a Reanimated one while it runs.
Check yourself
What problem did JSI solve compared with the old asynchronous bridge?
Free resources
- React Native architecture overview (React Native)
- Using Hermes (React Native)