React Nitro

Overview

Build native iOS and Android apps with React, TypeScript, and Nitro.

A React Nitro screen is a React component. Its elements become UIKit views on iOS and Android views on Android. You can start with two components from the renderer package.

src/App.tsx
import { Text, View } from 'react-nitro-renderer'

export function App() {
  return (
    <View layout={{ flex: 1, justifyContent: 'center', paddingHorizontal: 24 }}>
      <Text fontSize={28} fontWeight="bold">Field notes</Text>
      <Text>A notebook for your next walk.</Text>
    </View>
  )
}

Create an app to run this screen on a simulator or emulator. Then build your first screen to add an editable note and see how native input reaches React state.

How a screen reaches the device

The starter gives you a TypeScript entry point, an Xcode project, and a Gradle project. The entry point registers the root component. React describes the view tree, the layout engine measures and positions the views, and the renderer applies the result to the native controls. Hermes runs the app's JavaScript. Nitro connects it to native objects such as a view, a gesture recognizer, or a module you write.

If you know React Native, you can bring your React knowledge with you. React Nitro has its own runtime, renderer, and packages. Start with View and Text from react-nitro-renderer. When adding a library, check which host components and runtime APIs it imports.

Where to go next

This guide covers React Nitro 0.0.1-alpha.16.

On this page