Old architecture vs. new architecturePart 2 of 14
The old architecture
Four threads, one JSON bridge, and why it had to go
BeginnerVerified on React Native 0.88Updated 6 December 2026
Read first: Vocabulary
The big idea#
None of this runs in current React Native. It's still worth understanding, because every piece of the new architecture exists to fix one specific problem of the old one, and because old-style code still appears in many npm packages.
Concepts#
The threads#
- JS thread: runs the JavaScript bundle (React, state, business logic). There's only one.
- UI (main) thread: the platform's own thread. Only it may touch real views, and it receives touches.
- Shadow thread: keeps a copy of the view tree (the "shadow tree") and runs Yoga to calculate layout.
- Native modules thread(s): where native module calls like storage reads actually ran.
The bridge#
All communication between JS and native went through one channel:
- On the JS side,
MessageQueuecollected every call as[moduleId, methodId, args, callbackId]. - Calls were batched and flushed together, then serialized to JSON.
- Native code parsed the JSON, found the method by ID, and ran it.
- Results came back the same way, and only through callbacks or Promises. A method could never just return a value.
The old architecture
Boxes: JS thread (React, your logic); Bridge (JSON, async, batched); Shadow thread (Yoga layout); UI thread (Draws, gets touches). Arrows: JS thread to Bridge; Bridge to Shadow thread; Shadow thread to UI thread; UI thread to Bridge (dashed); Bridge to JS thread (dashed).
- JavaScript
- Legacy
- Native
One tap, end to end#
One tap in the old architecture
Boxes: UI thread (Receives touch); Bridge (Serialize event); JS thread (onPress, React diff); Bridge (UIManager commands); Shadow thread (Yoga layout); UI thread (Updates views). Arrows: UI thread to Bridge; Bridge to JS thread; JS thread to Bridge; Bridge to Shadow thread; Shadow thread to UI thread.
- Native
- Legacy
- JavaScript
The problems#
| Problem | What it meant | Symptom |
|---|---|---|
| Asynchronous only | JS could never get an answer immediately; even measure() used a callback | Layout jumps: render, measure a frame later, move |
| One JS thread | Touch handling, JS-driven animations and business logic shared one thread | Heavy JS freezes touch responses |
| Serialization | Every message was copied into a string and parsed back; nothing shared by reference | Big payloads (Base64 images, long lists) were slow |
| One shared lane | Every message waited in the same queue | Blank cells on fast scroll, dropped animation frames |
| Eager startup | Every native module created at launch, used or not | Slow startup with many native libraries |
| Per-platform renderers | Rendering logic written separately in Java and Objective-C | Platform-specific bugs |
Workarounds that predicted the future#
useNativeDriver: truesent an animation to native code once, so frames didn't cross the bridge.- Reanimated worklets ran small JS functions on the UI thread in a separate runtime, possible only because of JSI.
- Passing file paths instead of Base64 avoided serializing large data. Since 0.88,
ArrayBuffersolves this properly.
Myths vs reality#
Myth
The bridge was single-threaded, so computation had to happen on one thread
Reality: the bridge itself wasn't the single thread. The problem is that there was one JS thread, and everything JS-related (events, animations, logic) had to share it while waiting on an asynchronous queue.
In practice#
When reading native code in npm packages, these are legacy-bridge fingerprints:
- Android: a module that extends
ReactContextBaseJavaModuledirectly (not a generatedNative…Spec),ReactPackage.createNativeModules(), view managers without a generated…ManagerInterface. - iOS:
RCT_EXPORT_METHOD(...),RCTViewManagersubclasses withRCT_EXPORT_VIEW_PROPERTY. - JS:
NativeModules.XandrequireNativeComponent('X')instead ofNative*.tsspecs.
In one sentence
The old architecture forced every exchange between JS and native through one slow, asynchronous, JSON-serialized channel that copied everything, could never answer immediately, and created every module at startup.