NitroUI: React directly on the iOS and Android UI thread, without React NativeNote · digest for December 5
Cinematic 3D scene of NitroUI running on a smartphone's main UI thread: one direct light pulse from touch to screen with zero delay
Note3 sections≈ 5 min

NitroUI: React directly on the iOS and Android UI thread, without React Native

For years, mobile developers heard one golden rule: keep JavaScript off the smartphone's main UI thread, or your interface will freeze. In December 2026, Margelo and Callstack, the teams behind VisionCamera and Nitro Modules, did the opposite. They launched NitroUI, a framework that runs React straight on the main thread of iOS and Android for smooth UI updates.

Why React Native lags on scroll and how the UI thread fixes it

A phone's UI thread (Main Thread) is the OS thread that catches touches, scrolls lists, and draws frames. In React Native, JavaScript lives on a separate thread. Even with the New Architecture (JSI and Fabric), layers exchange tasks asynchronously, causing three classic headaches on fast screens:

  1. Fast scrolling shows blank cells because the native list needs a card right now, while the JS thread replies a frame late.
  2. A controlled TextInput with an input mask flickers as the character appears and gets reformatted a frame later from JS.
  3. Gestures sometimes read stale screen state.

NitroUI removes that boundary. React and TypeScript run on the main thread, just like React DOM in a browser or native Swift and Kotlin code. A tap, a React render, and a UIKit or Android View update all finish synchronously in one frame.

As the authors put it: 'This is React, not React Native.' You couldn't patch React Native to render on the main thread, so they wrote a new renderer and native layer from scratch.

Under the hood: renderer, Static Hermes, and layout engine

The core is a custom nitro-ui-renderer that maps React components to native iOS and Android views. Sizes and spacing move out of style into a separate layout prop.

import { useState } from 'react'
// Primitives from NitroUI's own renderer
import { Text, TextInput, View } from 'nitro-ui-renderer'

export function App() {
  const [note, setNote] = useState('')

  return (
    // Layout geometry uses a dedicated layout prop
    <View layout={{ flex: 1, padding: 20 }}>
      <Text fontSize={28} fontWeight="bold">Field notes</Text>
      <TextInput
        placeholder="What did you notice?"
        // Event and render run synchronously in the same frame
        onTextChanged={(change) => setNote(change.text)}
      />
      <Text>{note}</Text>
    </View>
  )
}

Typing a character triggers onTextChanged, updates state, and redraws Text in the exact same frame with zero flicker. List works the same way over UICollectionView (iOS) and RecyclerView (Android), filling cells right as they appear.

Three pieces drive this speed. Swift and Kotlin talk to JS through typed Nitro Modules bindings. In release builds, React and the renderer compile to native machine code via Static Hermes, while app code stays in Hermes bytecode for Fast Refresh and OTA updates.

For layout, Lynx Starlight is the default engine, though app.json lets you switch back to Yoga. On heavy screens, the speed gap is clear.

Recalculating one node in a 5,461-view tree

On a large tree, Starlight recalculates single-node changes much faster on both a new iPhone and an older Android phone. On small edits Yoga keeps up, but on crowded screens Starlight gives real headroom. The ios/ and android/ folders stay right in Git under Xcode and Gradle with no auto-generation.

The cost of sync and where the project stands

Running on the main thread means living inside a strict frame budget: 16.6 ms at 60 Hz and 8.3 ms on 120 Hz displays. A heavy loop or large JSON parse during render will freeze scrolling and gestures right away.

Lists feel this most. Fast scrolling brings several cells on screen at once as the native list recycles views. You can't keep local state like 'favorited' inside a cell; read it from item data or a store by ID. Images need recyclingKey so old photos don't flash, and MaskedView on icons quickly drops FPS on iOS.

Libraries built for React Native, Fabric, or Expo SDK (including react-native-reanimated) don't work here. Only pure hooks, business logic, and Nitro V1 modules carry over.

margelo/nitro-ui launched under MIT on December 1, 2026 (v0.3.0). Memory and bundle size benchmarks aren't out yet, web support has no dates, and iOS builds require Apple Silicon, Xcode 27, and Bun. Today it's ready for experiments and replacing heavy screens, as tested on the Mastodon iOS hashtag screen and an Android back gesture with a JS interpolator.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 8