Migrate a React Native app
Port an existing React Native or Expo app to NitroUI. Keep your React and TypeScript code and replace the parts that depend on the React Native runtime.
Start with one screen and the flow that leads to it. Keep the existing app running so you can compare both builds on iOS and Android.
What can you reuse?
| Part of the app | What to do in NitroUI |
|---|---|
| React hooks, state, and TypeScript logic | Reuse code that has no React Native or Expo dependency. Check the imports of shared packages, since a package can use the native runtime indirectly. |
| Screen layout and controls | Port the JSX to NitroUI components. Move layout properties from React Native's style to NitroUI's layout prop. |
| Navigation | Rebuild stacks and tabs with NitroUI navigation. Keep the route parameters and verify the paths users take to reach each screen. |
| Native libraries and modules | Look for a compatible NitroUI package or expose the underlying Swift, Kotlin, or C++ code through Nitro modules. |
Port your first screen
- Follow Installation to create a NitroUI project and run it alongside the original app.
- Keep the starter's
registerAppentry point. Replace its root component with your app's providers and the screen you want to port. - Switch imports for host components such as
ViewandTextfromreact-nativetonitro-ui-renderer. Check the component docs as you port each prop.
For example, move flex and padding from the React Native view's style object to layout:
import { Text, View } from 'nitro-ui-renderer'
export function App() {
return (
<View layout={{ flex: 1, padding: 16 }}>
<Text>Continue where you left off</Text>
</View>
)
}Exercise the same flow in both apps using the same data. Check that you can open the screen, complete its main action, and go back. Use Your first screen for a working example that connects native input to React state.
Before replacing a released app, test an in-place update on a device with the existing build installed. Use matching app identifiers and compatible signing, then check session state, stored data, and incoming links.
If you're migrating with a coding agent, give it the React Native migration skill and the original app's source.