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 Expo (2025 Edition)

Expo in React Native (2025 Edition): Real-World Experience Expo in React Native (2025 Edition): Real-World Experience, Pros, Cons & Use Cases ๐Ÿš€ I’ve been working with React Native for several years and have shipped multiple production applications using both bare React Native and :contentReference[oaicite:0]{index=0} . In 2025, Expo is often misunderstood — some developers still think it’s only for beginners, while others treat it as a magic solution for everything. This article is not a documentation rewrite. Instead, I’m sharing how Expo actually behaves in real projects, where it shines, where it struggles, and when it makes sense to use it. What Is Expo (In Simple Terms)? Expo is a framework and ecosystem built on top of React Native that helps you build iOS, Android, and web apps faster by reducing native setup and handling builds, updates, and deployments for you. In 2025, Expo has evolved into a production-ready platform used by st...