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-android-integration.md


title: Expo Android Integration impact: HIGH tags: react-native, brownfield, expo, android, aar, reactnativehostmanager

Skill: Expo Android Integration

Package and publish Expo Android AAR, then initialize host runtime and mount RN UI.

Quick Command

npx brownfield package:android --module-name <android_module_name> --variant release
npx brownfield publish:android --module-name <android_module_name>

Record moduleName/variant and the android.expo plugin options in brownfield.config.* instead of repeating them — see cli-and-config.md for the full option set.

When to Use

  • User requests Expo Android brownfield integration
  • Host app must consume Expo-backed RN AAR

Prerequisites

  • expo-quick-start.md completed
  • Android host app builds and syncs
  • Android module name resolved (brownfieldlib by default unless overridden in Expo plugin options)

Agent-Assisted Verification

Use agent-device after the host build succeeds. Read the agent-device skill or CLI help when available before exact commands. If it is missing and verification needs it, install it through the environment's approved/trusted path or ask the user to install or enable it. Then open the host app, navigate to the Expo-backed RN surface, capture snapshots/screenshots, and collect logs for runtime behavior.

Step-by-Step Instructions

Progress checklist:
- [ ] Package AAR
- [ ] Publish to Maven local
- [ ] Initialize host runtime
- [ ] Render RN module
  1. Build AAR:
    • npx brownfield package:android --module-name <android_module_name> --variant release
  2. Publish to Maven local:
    • npx brownfield publish:android --module-name <android_module_name>
  3. Initialize runtime in Activity or Application:
ReactNativeHostManager.initialize(application) {
  Toast.makeText(this, "React Native has been loaded", Toast.LENGTH_LONG).show()
}
  1. Forward configuration changes:
override fun onConfigurationChanged(newConfig: Configuration) {
    super.onConfigurationChanged(newConfig)
    ReactNativeHostManager.onConfigurationChanged(application, newConfig)
}
  1. Render RN UI with JS-registered module name:
    • ReactNativeFragment.createReactNativeFragment("<registered_module_name>", initialProps)
    • or ReactNativeBrownfield.shared.createView(activity, "<registered_module_name>", reactDelegate, launchOptions)
    • in Compose, AndroidFragment<ReactNativeFragment> with the ReactNativeFragmentArgNames constants
    • see runtime-api.md for the full signatures

Stop Conditions

Mark complete only if:

  • package and publish commands both exit with code 0
  • host app resolves published dependency and renders module
  • device evidence is captured with agent-device when possible

Canonical Docs

Common Pitfalls

  • Using ComponentActivity with Expo (use AppCompatActivity)
  • Missing ReactNativeHostManager.initialize(...) before UI creation
  • Module name mismatch with AppRegistry.registerComponent

Related Skills