React Native lets you build mobile apps using JavaScript. It uses a special system to connect your JavaScript code with native mobile parts so your app feels fast and smooth.
React Native architecture (bridge, new architecture)
/* React Native uses a Bridge to connect JavaScript and native code */
// Old architecture:
JavaScript thread <--> Bridge <--> Native thread
// New architecture (Fabric + TurboModules):
JavaScript thread <--> JS Interface <--> Native Modules + Fabric RendererThe Bridge is like a messenger between JavaScript and native code.
The New Architecture improves speed by reducing the bridge and using direct calls.
// Old Bridge example
// JS sends a command to native to show an alert
NativeModules.AlertManager.showAlert('Hello!')// New Architecture uses TurboModules // JS calls native module directly without bridge delay const alertModule = require('AlertModule'); alertModule.showAlert('Hello!')
This simple app shows a button. When you press it, it uses React Native's native alert feature. Behind the scenes, React Native uses its architecture to connect the JavaScript button press to the native alert popup.
import React from 'react'; import {Button, Alert, View} from 'react-native'; export default function App() { const showAlert = () => { Alert.alert('Hello from React Native!'); }; return ( <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}> <Button title="Press me" onPress={showAlert} accessibilityLabel="Show alert button" /> </View> ); }
The old bridge sends messages back and forth, which can slow down complex apps.
The new architecture uses Fabric for UI and TurboModules for faster native calls.
Understanding this helps you write better React Native apps and debug performance issues.
React Native connects JavaScript and native code using a bridge system.
The new architecture improves speed by reducing bridge overhead.
Knowing this helps you build faster and smoother mobile apps.