Quick Start

Download a free copy of Incremental React Native adoption in native apps ebook

Installation

The React Native Brownfield library is intended to be installed in a React Native app that is later consumed as a framework artifact by your native iOS or Android app.

In your React Native project run:

npm
yarn
pnpm
bun
deno
npm install @callstack/react-native-brownfield

iOS Setup

Run pod install in your iOS directory.

Android Setup

The library will be automatically linked via autolinking.

What is the Brownfield CLI?

The @callstack/react-native-brownfield package includes a built-in CLI that handles the complex process of packaging your React Native app into native framework artifacts.

Why do you need it?

Integrating React Native into an existing native app requires packaging your JavaScript code and native dependencies into formats that native apps can consume:

  • iOSXCFramework (.xcframework)
  • AndroidAAR (.aar)

Without the CLI, this process involves:

  • Manually configuring build scripts
  • Bundling JavaScript with the correct settings
  • Compiling native code for multiple architectures
  • Handling Hermes bytecode compilation
  • Managing native dependencies and linking

The Brownfield CLI automates all of this with simple commands.

What does it do?

CommandPlatformOutput
package:iosiOSCreates an XCFramework containing your React Native app, Hermes runtime, and all native dependencies
package:aarAndroidCreates a Fat-AAR containing your React Native app bundled with all native dependencies
publish-local:aarAndroidPublishes the AAR to your local Maven repository for easy consumption

How does it make integration easier?

  1. No Node.js in your native app - Your native iOS/Android app doesn't need Node.js, npm, or any JavaScript tooling installed
  2. Single artifact - All React Native code and dependencies are bundled into one file
  3. Debug & Release support - The CLI handles both configurations automatically
  4. Architecture support - Builds for all required CPU architectures (arm64, x86_64, etc.)

Next Steps

Now that you have the library installed, follow the platform-specific guides to package your React Native app and integrate it with your native app:

API Reference

For detailed API documentation, see:

Guidelines

Read the Guidelines for best practices on integrating React Native into your native app.

Need React or React Native expertise you can count on?