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...

React Native Expo (2025 Edition)

Expo in React Native: Everything You Need to Know (2025 Edition) Everything You Need to Know About Expo in 2025 ๐Ÿš€ Expo is a framework and platform for universal React applications. It simplifies the development and deployment process of React Native apps with powerful tools and services. As of 2025, Expo has matured into an all-in-one toolkit that supports everything from development to distribution. ๐Ÿ“ฆ What is Expo? Expo is a set of tools built around React Native to help you build native iOS, Android, and web apps using JavaScript and React. It removes native dependencies, making it easier for JavaScript developers to build and deploy native apps quickly. ๐Ÿงฐ Key Services Provided by Expo Expo Go: Preview your app without needing to build a native binary. Expo Dev Client: Customizable development client for testing native modules. EAS Build: Build your app in the cloud for iOS and Android. EAS Submit: Submit builds to...

Expo SDK 53 Beta Now Live – Explore New Features Today

New Release: Expo SDK 53 Beta Now Available for Developers Here are the key highlights from the Expo SDK 53 release notes that are particularly relevant for your interest in performance improvements, new features, and support for various modules: ๐Ÿš€ Performance & Architecture 1. New Architecture is Now Default All new projects ( npx create-expo-app ) will now use the New Architecture by default. This includes Hermes , Fabric , and TurboModules for both iOS and Android. You can still disable the new architecture by setting EXPO_ENABLE_NEW_ARCHITECTURE=false . 2. Startup Time Improvements Thanks to the New Architecture and general optimizations, startup performance has improved. Support for React Native 0.73 , bringing improved performance, bug fixes, and updated UI features.