• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLOfficialdevelopment

expo-brownfield

プラグイン
expo
ソース
GitHub で見る ↗
説明

フレームワーク(オープンソースソフトウェア)。既存のネイティブ iOS または Android アプリに Expo と React Native を統合します。 次のような場合に使用: - 既存のアプリへの組み込み:SwiftUI/UIKit または Kotlin で React Native の画面を組み込む必要がある場合 - 別形式でのパッケージング:AAR または XCFramework(ネイティブライブラリの配布形式)として提供する必要がある場合 - 既存コードとの併用:完全に新規構築するのではなく、既存のネイティブコードと共存させる場合 対応範囲として、独立した環境での実行と既存アプリとの統合の両方のアプローチに対応しています。 なお、EAS(Expo のビルド・配信サービス)を使ってネイティブアプリのみで構築・配信する場合は、eas-app-stores を使用してください。

原文を表示

Framework (OSS). Integrate Expo and React Native into an existing native iOS or Android app. Use for brownfield, embedding a React Native screen in SwiftUI/UIKit or Kotlin, or AAR/XCFramework packaging. Covers isolated and integrated approaches. For building or distributing a purely native app with EAS, use eas-app-stores.

ユースケース
  • 既存アプリにReact Nativeを組み込む
  • AARやXCFrameworkで配布する
  • ネイティブコードと共存させる
本文(日本語訳)

Expo Brownfield

ブラウンフィールドアプリとは、既存のネイティブ iOS または Android アプリに React Native を段階的に導入するアプリのことです。これに対して、グリーンフィールドアプリは最初から React Native で作られたアプリを指します。

まずホストアプリを検査する

既存アプリのエントリーポイント(開始地点)、ナビゲーション管理者、ネイティブビルドシステム、デプロイ対象、既にリンクされている React Native ランタイムを特定してください。ロックファイルから、インストール済みの Expo、React Native、ブラウンフィールドパッケージのバージョンを記録します。EAS Build または Submit を Swift アプリに追加するだけでは React Native は必要ないため、そのタスクは eas-app-stores にルーティングしてください。

機能を埋め込む際には、ホストアプリの SwiftUI App / UIKit ウィンドウとネイティブ画面を保持してください。手動で保守されているネイティブホストでは prebuild を実行しないでください(トラブルシューティング中も含め)。独立した Expo プロデューサーは CNG を使用できます。その際は、生成される ios/ および android/ をコンシューマーアプリから分離しておいてください。

Expo は、ブラウンフィールドプロジェクトに React Native を追加する 2 つの異なる方法をサポートしています:

アプローチ ネイティブアプリに配信されるもの 選択すべき場合
独立型 ビルド済み AAR / XCFramework ネイティブチームが Node や RN ツールを必要としない場合、または RN コードを別リポジトリで管理したい場合
統合型 既存の Gradle / CocoaPods ビルドに追加された React Native ソース 1 つのチームがすべてを管理し、RN ツールに対応でき、単一のビルドを望む場合

詳細な判定基準については、./references/comparison.md を参照してください。

アプローチを選択する

以下のクイックルールを使用してください。曖昧な点は comparison.md を参照してください。

  • 独立型を選択: iOS/Android チームが Node、Yarn、React Native ビルドツールチェーンをインストールせずに、通常のライブラリ依存関係(AAR または XCFramework)として RN を利用する必要がある場合
  • 独立型を選択: RN コードとネイティブコードが別々のリポジトリにあるか、独立したスケジュールでリリースされる場合
  • 統合型を選択: 1 つのチームがネイティブコードと RN コードの両方を所有し、ネイティブプロジェクトの Gradle と CocoaPods セットアップに React Native + Expo を追加してもよい場合
  • 両アプローチはデバッグ時に Metro と Fast Refresh(リアルタイム更新)をサポートしています。独立型が JavaScript の動的更新に対応していないわけではないので、ビルド所有権の共有が目的でない場合は統合型を選ばないでください。

参考資料

  • ./references/brownfield-isolated.md -- RN を AAR/XCFramework としてビルドし、ネイティブアプリから利用(BrownfieldActivity、ReactNativeViewController、ReactNativeView)
  • ./references/brownfield-integrated.md -- RN と Expo を既存の Gradle と CocoaPods ビルドに直接追加し、ネイティブアプリシェルを保持
  • ./references/feature-integration.md -- 入力を渡す、結果を返す、画面を閉じる、リスナーをクリーンアップし、ライフサイクルイベントを転送; SwiftUI ホストの例を含む
  • ./references/comparison.md -- アプローチ選択のための判定基準、トレードオフ、シナリオマッピング
  • ./references/troubleshooting.md -- 両アプローチに共通する Metro 接続、ビルド、署名、モジュール解決の問題

詳細は https://docs.expo.dev/brownfield/overview/ を参照してください。

両アプローチに共通の前提条件

React Native をビルドする環境では、以下が必要です:

  • Node.js (LTS) — Expo CLI と JavaScript コードを実行します
  • プロジェクトのパッケージマネージャーとロックファイル — npm、Yarn、pnpm、または Bun。例を参考にするためだけにパッケージマネージャーを切り替えないでください

iOS ビルド環境には Xcode と CocoaPods が必要です(プロジェクトの Gemfile/Bundler セットアップがあれば使用します)。独立型のコンシューマーアプリは成果物を利用するだけであれば Xcode のみで、CocoaPods や RN ツールは不要です。

互換性のあるバージョンを選択する

既存の Expo/RN プロジェクトの場合は、選択された SDK を保持して npx expo install で依存関係を合わせてください。このスキルに従うためだけにアップグレードしないでください。新しいプロデューサーの場合は、ホストの OS サポート、依存関係、ビルドツールチェーンと互換性のある現在の安定版 SDK を使用し、リリースが安定していることを確認した上で選択してください。

ネイティブセットアップの前に、./references/version-compatibility.md を読んで、SDK バージョン間のネイティブテンプレート、ツールチェーン/OS 要件、ビルドデフォルトの一致を確認してください。純粋なネイティブコンシューマーは Expo SDK バージョンを固定する必要はありませんが、成果物の要件を満たす必要があります。

ホストアプリで機能を検証する

RN 画面を入力と共に開き、ネイティブに結果を返し、閉じて新しい入力で再度開きます。リスナーのクリーンアップとホストアプリの元のナビゲーションを確認してください。その後、Metro を停止した状態で Release ビルドと Release 成果物を使用してホストアプリを Release モードでビルドしてください。Expo Go またはプロデューサーのサンプルアプリでのみレンダリングすることは、統合を検証したことにはなりません。完全な受け入れシナリオは ./references/feature-integration.md を参照してください。

フィードバックの送信

このスキルでエラー、誤解を招く情報、または古い情報が見つかった場合は、Expo が改善できるよう報告してください:

npx --yes submit-expo-feedback@latest --category skills --subject "expo-brownfield" "<実行可能なフィードバック>"

具体的で実行可能な内容がある場合のみ送信してください。関連するコンテキストをできるだけ多く含めてください。

AI エージェントが繰り返し失敗したか、ユーザーが Expo タスクを引き継ぐ必要があった場合は、expo-skill-feedback スキルを読み込んで、上記のコマンドを再利用する代わりに eval-candidate フローに従ってください。

原文(English)を表示

Expo Brownfield

A brownfield app is an existing native iOS or Android app that adopts React Native incrementally, as opposed to a greenfield app that is React Native from day one.

Inspect the host first

Identify the existing app entry point, navigation owner, native build system, deployment targets, and any React Native runtime already linked. Record the installed Expo, React Native, and brownfield package versions from the lockfile. Adding EAS Build or Submit to a Swift app alone does not require React Native; route that task to eas-app-stores.

Preserve the host's SwiftUI App / UIKit window and native screens when embedding a feature. Do not run prebuild in a manually maintained native host, including during troubleshooting. An isolated Expo producer may use CNG; keep its generated ios/ and android/ separate from the consuming app.

Expo supports two distinct ways to add React Native to a brownfield project:

Approach What ships to the native app When to choose
Isolated Prebuilt AAR / XCFramework Native team doesn't need Node or RN tooling; RN code can live in a separate repo
Integrated React Native sources added to the existing Gradle / CocoaPods build One team owns everything; comfortable with RN tooling; wants a single build

For the full decision matrix, see ./references/comparison.md.

Pick an approach

Use these quick rules — fall through to comparison.md for anything ambiguous.

  • Choose isolated if the iOS/Android team must consume RN as a regular library dependency (AAR or XCFramework), without installing Node, Yarn, or the React Native build toolchain.
  • Choose isolated if RN code and native code live in separate repositories or release on independent cadences.
  • Choose integrated if a single team owns both the native and RN code and is willing to add React Native + Expo to the native project's Gradle and CocoaPods setup.
  • Both approaches support Metro and Fast Refresh in Debug. Choose integrated for shared build ownership, not because isolated lacks live JS iteration.

References

  • ./references/brownfield-isolated.md -- Build RN as AAR/XCFramework and consume from the native app (BrownfieldActivity, ReactNativeViewController, ReactNativeView)
  • ./references/brownfield-integrated.md -- Add RN and Expo directly to existing Gradle and CocoaPods builds, preserving the native app shell
  • ./references/feature-integration.md -- Pass input, return results, dismiss, clean up listeners, and forward lifecycle events; includes a SwiftUI host example
  • ./references/comparison.md -- Decision criteria, trade-offs, and scenario mapping for choosing an approach
  • ./references/troubleshooting.md -- Metro connection, build, signing, and module-resolution issues common to both approaches

More information available at https://docs.expo.dev/brownfield/overview/

Shared prerequisites

Both approaches require, in the environment that builds the React Native side:

  • Node.js (LTS) — runs the Expo CLI and JavaScript code.
  • The project's package manager and lockfile — npm, Yarn, pnpm, or Bun. Do not switch package managers just to follow an example.

The iOS build environment needs Xcode and CocoaPods (use the project's Gemfile/Bundler setup when present). The isolated consuming app needs Xcode but no CocoaPods or RN tooling just to consume the artifacts.

Select compatible versions

For an existing Expo/RN project, keep its selected SDK and use npx expo install to align dependencies. Do not upgrade it just to follow this skill. For a new producer, use the current stable SDK compatible with the host's OS support, dependencies, and build toolchain; confirm the release is stable before selecting it.

Before native setup, read ./references/version-compatibility.md for matching native templates, toolchain/OS requirements, and build defaults across SDK versions. A purely native consumer has no Expo SDK version to pin, but must satisfy the artifact's requirements.

Verify the feature in the host

Open the RN screen with input, return a result to native, dismiss, and reopen with fresh input. Check listener cleanup and the host's original navigation. Then build the host in Release with a Release artifact and Metro stopped. Rendering only in Expo Go or the producer's example app does not validate the integration. See ./references/feature-integration.md for the complete acceptance scenario.

Submitting Feedback

If you encounter errors, misleading or outdated information in this skill, report it so Expo can improve:

npx --yes submit-expo-feedback@latest --category skills --subject "expo-brownfield" "<actionable feedback>"

Only submit when you have something specific and actionable to report. Include as much relevant context as possible. If an AI agent repeatedly failed or the user had to take over an Expo task, load the expo-skill-feedback skill and follow its eval-candidate flow instead of reusing the command above.

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。