AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

react-native-brownfield-migration

Implements an accepted incremental brownfield migration from native iOS or Android to React Native or Expo using @callstack/react-native-brownfield. Use after the brownfield path has been selected, when setting up the integration, packaging XCFramework or AAR artifacts, or adding React Native surfaces to native hosts.

Original source
callstackincubator
License
MIT
Pinned revision
59e9d17446a248b21d86f078fcd0bd2d36db1ca4

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

This skill also requires local files or dependencies. Remote reading alone may not be enough.

Ask your assistant

Use Agentic Memory skills to read callstackincubator--react-native-brownfield-migration at revision 59e9d17446a248b21d86f078fcd0bd2d36db1ca4, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 13

references/expo-quick-start.md


title: Expo Brownfield Quick Start impact: CRITICAL tags: react-native, brownfield, expo, app.json, plugin, setup

Skill: Expo Brownfield Quick Start

Configure Expo project for brownfield packaging before iOS/Android host integration.

Quick Command

npm install @callstack/react-native-brownfield

When to Use

  • Expo managed or prebuild project needs brownfield packaging
  • Continuing after expo-create-app.md

Prerequisites

  • Expo project with app.json
  • Expo path selected in router

Step-by-Step Instructions

Progress checklist:
- [ ] Install package
- [ ] Configure plugin
- [ ] Create brownfield config
- [ ] Continue to platform integration
  1. Install package in the Expo project.
  2. Add plugin to app.json:
{
  "plugins": ["@callstack/react-native-brownfield"]
}
  1. Create the brownfield configuration — the iOS scheme, the Android module name and variant, and any ios.expo / android.expo plugin options — so packaging commands stay short. See cli-and-config.md; exactly one config source is allowed.
  2. Optionally add package scripts for packaging/publish commands used by your team.
  3. If the app uses expo-router, set up the brownfield entry point (see Expo Router entry point).
  4. Continue to exactly one platform file:

Expo Router entry point

Apply this only when the app uses expo-router and the native host must mount a named module. Do not change package.json.main for bare React Native apps, Expo apps without expo-router, or projects that already have a working brownfield entry point.

expo-router/entry registers only Expo's default main component, so the native host cannot look up its own module name. If package.json has "main": "expo-router/entry", change it to "index.tsx" and create index.tsx at the project root:

import { registerRootComponent } from 'expo';
import { AppRegistry } from 'react-native';

import { App as ExpoRouterApp } from 'expo-router/build/qualified-entry';

export const BROWNFIELD_MODULE_NAME = 'MyBrownfieldModule';

// Keeps Expo's default "main" registration (expo start, expo run:ios, fast refresh).
registerRootComponent(ExpoRouterApp);

// Registers the same root under the name the native host mounts:
//   ReactNativeBrownfield.shared.view(moduleName: "MyBrownfieldModule")
AppRegistry.registerComponent(BROWNFIELD_MODULE_NAME, () => ExpoRouterApp);

Notes:

  • Import App from expo-router/build/qualified-entry. It resolves expo-router/_ctx against the auto-detected router root (for example src/app), so do not hand-roll require.context('./app') with a hardcoded path.
  • Adapt BROWNFIELD_MODULE_NAME to the module name the host uses; it must equal the string passed to ReactNativeView(moduleName:) / view(moduleName:).
  • To expose additional feature modules, add more AppRegistry.registerComponent('<Name>', () => <Component>) lines. Import local files without a .tsx extension.

Canonical Docs

Common Pitfalls

  • Missing plugin entry in app.json
  • package.json.main still expo-router/entry, so the native module name is never registered
  • Mixing Expo flow with bare packaging files

Related Skills