Old architecture vs. new architecturePart 5 of 14

The event loop

How React Native decides what runs next, and when the screen updates

IntermediateVerified on React Native 0.88Updated 6 December 2026

Read first: Bridgeless mode

The big idea#

An event loop is the rule a thread follows to decide what runs next. The old architecture didn't have one: the JS thread worked through bridge batches in whatever order they arrived. The new architecture uses the model browsers use, implemented in a C++ class called RuntimeScheduler, and it comes with one firm guarantee: nothing is painted while a task is still running.

Concepts#

The web model#

  1. Run one task, such as a touch handler, a timer callback or a native module result.
  2. Run every microtask: resolved Promise callbacks and await continuations, including new ones added while the queue drains.
  3. Update the rendering, so the screen shows the result.
  4. Repeat.

The event loop inside RuntimeScheduler

Native events
Timers
Native callbacks
React work
Task queueSorted by priority
Run one taskJS thread, Hermes
Drain microtasksPromises, await
Update renderingFabric mounts views

Boxes: Native events; Timers; Native callbacks; React work; Task queue (Sorted by priority); Run one task (JS thread, Hermes); Drain microtasks (Promises, await); Update rendering (Fabric mounts views). Arrows: Native events to Task queue; Timers to Task queue; Native callbacks to Task queue; React work to Task queue; Task queue to Run one task; Run one task to Drain microtasks; Drain microtasks to Update rendering; Update rendering to Task queue (next turn).

5 steps

The screen can only change in the last step of each turn.
  • Other
  • C++
  • JavaScript
  • Native

Before: no defined loop#

Under the bridge, a task was whatever messages a bridge batch happened to contain, often several unrelated things. Promises were a JS polyfill scheduled with setImmediate, so they ran at the end of each batch rather than after each task. And there was no render step at all: React's changes went out at the end of a batch, were laid out later on the shadow thread, and were painted later still.

This showed up in three ways. Layout jumped, because measure() was asynchronous: a component rendered in the wrong place, was measured a frame later, then moved. Batching was inconsistent, so setState inside a .then or a setTimeout caused its own render. And nothing had priority, so a tap could wait behind a large list update.

After: what it fixes#

The first change is synchronous layout. Fabric calculates layout in C++ during the commit, so useLayoutEffect can measure and correct positions before anything is painted:

TSX
function Tooltip({ targetRef, children }) {
  const ref = useRef<View>(null);
  const [top, setTop] = useState(0);

  useLayoutEffect(() => {
    const target = targetRef.current!.getBoundingClientRect(); // synchronous
    const self = ref.current!.getBoundingClientRect();         // synchronous
    setTop(target.top - self.height); // re-render in the SAME task
  }, []);

  return <View ref={ref} style={{ position: 'absolute', top }}>{children}</View>;
}

Batching becomes automatic: every setState in the same task turns into one render, including those inside Promises, timers and native callbacks. And work finally has priorities. A tap is high priority, work wrapped in startTransition is low priority and can be interrupted, and Suspense works fully.

The event loop, before and after

BeforeAfter
Unit of workA bridge batchOne task, chosen by priority
PromisesJS polyfill, end of batchNative Hermes microtasks, after each task
RenderingAsync across three threadsA defined step; nothing painted mid-task
Reading layoutAsync measure(callback)Synchronous in useLayoutEffect
BatchingOnly in event handlersEverywhere
PrioritiesNoneDiscrete events, transitions, Suspense
RuntimeScheduler replaced 'whatever the bridge delivered'.

In practice#

  • Microtasks can block painting. A long chain of awaits, or heavy work in a .then, all runs before the render step. To let the screen update, end the task with setTimeout(..., 0) or requestAnimationFrame.
  • await doesn't mean "next frame". Code after an already-resolved Promise runs before paint, in the same turn.
  • Reanimated worklets aren't affected, because they run on the UI thread in their own runtime.
  • If you write native modules, never touch the jsi::Runtime from a background thread. Hand results back through CallInvoker, which schedules a task. Resolving a Promise from native creates a task, and the JS code after await runs as a microtask inside it.
  • Since 0.88, event dispatching also follows the web: W3C EventTarget with capture and bubble phases.

In one sentence

Bridgeless replaced bridge batches with a real event loop (one task, then its microtasks, then a render), and that is what makes synchronous layout in useLayoutEffect, automatic batching and priorities possible.