Skip to main content

🧠 How React Native Internally Works (2025 Edition)

How React Native Internally Works (2025 Edition)

React Native is a powerful framework for building cross-platform mobile applications using JavaScript. But how does it bridge the gap between JavaScript and native mobile platforms? Let’s dive into the internals of React Native and understand its architecture.

πŸ—️ 1. Core Architecture Overview

React Native’s architecture has evolved significantly:

Era Key Feature
Legacy Architecture Bridge model with async JSON message passing
Fabric (2022+) Synchronous layout + native rendering
New Architecture (2023+) TurboModules + JSI + Codegen + Fabric

πŸ”— 2. JavaScript & Native Bridge (Legacy)

In the legacy model, JavaScript and native code communicated via an asynchronous bridge using serialized JSON. This meant:

  • Separate JS and native threads
  • Asynchronous message queue
  • Performance bottlenecks, especially for animations

⚙️ 3. JavaScript Interface (JSI)

JSI is a C++ interface allowing JavaScript to interact directly with native/C++ objects. It removes the old message bridge and enables faster, synchronous access:

// Native C++ JSI module example
jsi::Function myFunc = jsi::Function::createFromHostFunction(
  runtime,
  jsi::PropNameID::forAscii(runtime, "add"),
  2,
  [](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) {
    return jsi::Value(args[0].asNumber() + args[1].asNumber());
  });

🧩 4. TurboModules

TurboModules are the new way of loading native modules on demand:

  • Lazy-loaded for efficiency
  • Accessed via JSI
  • Better performance and lower memory usage

🧱 5. Fabric UI Manager

Fabric is the modern UI manager that synchronously manages layout and rendering:

  • Uses Yoga layout engine
  • Shadow tree replaces virtual DOM
  • Sends commit instructions via JSI

πŸ§ͺ 6. Hermes Engine

Hermes is an open-source JavaScript engine by Meta optimized for mobile:

  • Improves startup time
  • Reduces memory usage
  • Optimized garbage collection
  • Fully supports JSI

πŸ–‡️ 7. Native Rendering

Once the layout is resolved by Fabric and Yoga, the platform-specific UI is rendered:

  • Android uses ViewManagers
  • iOS uses UIView/UIViewController
  • Rendering is completely native, offering smooth experiences

πŸ”„ 8. React Native Internals Workflow (Diagram)

 ┌────────────┐
 │ JS Bundle  │
 └────┬───────┘
      │
   [Hermes/JSC]
      │
  [React Reconciler]
      │
      ▼
[Shadow Tree (Fabric)]
      │
  [Yoga Layout Engine]
      │
      ▼
[Native UI via JSI]
   (iOS/Android Views)
  

πŸ”„ 9. What Happens on Button Press?

  1. User taps a button.
  2. Native sends event to JS thread.
  3. JS executes onPress handler.
  4. State updates cause virtual DOM diff.
  5. Fabric generates new shadow tree.
  6. Yoga recalculates layout.
  7. JSI commits UI updates to native.

⚖️ 10. Old Architecture vs New

Feature Old Bridge New Architecture
Communication Async JSON bridge JSI (synchronous)
Native Modules Classic Modules TurboModules
Layout Engine UI Manager Fabric + Yoga
JS Engine JSC Hermes
Startup Time Slower Faster

🧠 Final Thoughts

The evolution of React Native’s internals — from the legacy bridge to JSI, TurboModules, and Fabric — brings a closer-to-native performance model. As developers in 2025, understanding this architecture helps us build faster, more efficient, and scalable mobile apps.

Comments

Popular posts from this blog

⚠️ React Native 0.79 (New Architecture) – Common Issues & Quick Fixes

React Native 0.79 (New Architecture) – Common Issues & Fixes With React Native 0.79 (part of Expo SDK 53 ), the New Architecture — which includes TurboModules , Fabric , and JSI — is now enabled by default. While this delivers better performance and platform-native alignment, many developers are encountering critical issues while upgrading or starting fresh projects. πŸ” Brief: What’s Going Wrong? 1. Third-Party Library Crashes Libraries like react-native-maps or @stripe/stripe-react-native might crash due to incompatibility with TurboModules or Fabric rendering. 2. Build & Runtime Errors Common issues include build failures related to CMake, Hermes, or JSI, and runtime UI bugs — especially on Android with edge-to-edge layout behavior. 3. Component Rendering Issues Blank screens, flickering components, or gesture conflicts due to changes in how the new rendering system manages views. ✅ Solutions & Fixes 1...

Edge-to-Edge UI in Android with React Native: How to Do It Right (2025 Update)

Intro Starting from 2024-25, Android apps are expected to embrace edge-to-edge UI — where your app content flows behind the system bars (status bar, navigation bar) for a fully immersive experience. Google is pushing for it hard, and React Native (especially with New Architecture and Expo SDK 53+) has made it much easier to implement. In this blog, I’ll walk you through: ✅ Why edge-to-edge matters for modern Android apps ✅ How to implement it correctly in React Native (Expo & Bare projects) ✅ Handling tricky parts like keyboard, gestures, and safe areas ✅ Real-world gotchas I ran into — and how to fix them Why Edge-to-Edge? Modern Android design guidelines (Material You) heavily prefer edge-to-edge layouts. It makes apps feel more native, more immersive, and makes better use of larger phone screens. Plus, starting Android 15, apps that don't adopt it might feel noticeably "outdated". How to Do It in React Native πŸš€ ...

React Native’s New Architecture in Action: Real-World Benefits & Migration Tips

Intro React Native’s New Architecture — featuring Fabric, TurboModules, and the Codegen system — has officially moved past the “experimental” tag. With Expo SDK 53+ adopting it by default and major libraries like react-native-reanimated , react-native-gesture-handler , and @stripe/stripe-react-native now supporting it, 2025 is the year to take it seriously. But what does it really offer in practice? And how do you migrate smoothly? In this blog, I’ll break down: What the New Architecture actually brings to the table Real-world performance & developer experience gains Migration tips (with Expo & bare React Native workflows) Gotchas and stability issues I’ve personally faced — and how I fixed them What Is the New Architecture? The New Architecture in React Native introduces: Fabric: A new rendering system, enabling asynchronous and concurrent rendering. TurboModules: Faster and more efficient native modul...