场景 052 · Codex Use Case

使用 Expo 构建 React Native 应用

遵循 Expo Router 与原生包约定,先用 Expo Go 快速测试,仅必要时切换 dev client 或 EAS。

MobileEngineering
Build React Native apps with ExpoMobileEngineering

原文核对:2026-10-13 · 中文正文 · 英文提示词与演示

场景定位

遵循 Expo Router 与原生包约定,先用 Expo Go 快速测试,仅必要时切换 dev client 或 EAS。

难度
中级
时间跨度
1 小时

适合用于

  • 希望先用 Expo 原型化或交付移动应用的开发者。
  • 需要遵循路由、UI、安装、构建和部署约定的 Expo Router 项目。
  • 将 Web 应用迁移到移动端的开发者。

相关工具

Expo

使用 Expo 官方技能处理 Router、原生 UI、取数、dev client、部署、升级、模块与 Codex Run。

Expo ↗

起步提示词

英文原文 · 可复制后按实际材料修改

Use the Expo plugin to build a React Native app with Expo for this idea:

[describe the app idea, target users, and the main workflow]

Requirements:
- Start with Expo Router and Expo-native project conventions.
- Try `npx expo start` and Expo Go first before creating a custom build.
- Use `npx expo install` for Expo packages so dependencies stay compatible.
- Use native-feeling UI patterns for navigation, forms, lists, empty states, and loading states.

Deliver:
- the working app slice
- the run command
- the verification path you used, including Expo Go, device, simulator, dev client, or EAS

从 Expo Go 开始

先 expo start,再用设备上的 Expo Go 测试;需要自定义原生代码、商店分发或 Expo Go 不支持的能力时,再用 dev client 或 EAS。

这样首轮可聚焦应用流程,减少 IDE、模拟器、provisioning 和构建配置准备。

使用 Expo 插件

Expo 官方插件涵盖 Router、UI、表单、导航、动画、取数、NativeWind、模块、dev client、部署、升级和 Run 操作。

构建页面、加包、接 API、准备 dev client 或 TestFlight/App Store/Play Store/EAS Hosting 时使用。

需要当前文档、兼容包安装、EAS 构建与工作流、截图、模拟器、React Native DevTools 或 TestFlight 数据时,可加 Expo MCP Server。

迭代步骤

  1. 检查仓库,确认新建还是已有 Expo 项目。
  2. 从 Expo Router 和 Expo Go 开始,加包用 npx expo install。
  3. 完成一个含原生导航、加载、空状态和错误状态的完整流程。
  4. 用设备或模拟器上最快的路径验证,必要时再转 dev client/EAS。

后续提示词

官方提示词

英文原文 · 可复制后按实际材料修改

Use the Expo plugin to add the following [feature/screen/flow] to this app:

[describe one feature, screen or user flow]

Constraints:

- Keep Expo Router as the routing layer.
- Use Expo-compatible package installs.
- Test with Expo Go first.
- Move to dev client or EAS only if this feature requires it.

After implementing, tell me the exact run path you used and what you verified.

技术栈

需要默认选项用途
移动框架Expo 和 React NativeExpo ↗React Native ↗为 Codex 提供受管理的 React Native 开发路径,支持快速迭代、兼容的软件包和部署工具。
路由Expo RouterExpo Router ↗以文件组织可预测的导航,让 Codex 添加页面和流程时无需自行设计路由层。
展开英文原文对照

Use Codex with the Expo plugin to scaffold React Native apps, stay inside Expo Router and Expo-native package conventions, test quickly with Expo Go, and move to dev clients or EAS builds only when the app needs them.

Start with Expo Go

Expo is a strong default when you want Codex to move from a mobile-app idea to a tested React Native app. The useful loop is expo start first, Expo Go on a device next, and then a dev client or EAS build only when the app needs custom native code, store distribution, or a capability that Expo Go can’t run.

That keeps Codex focused on the app workflow instead of spending the first pass on native IDE setup, simulator setup, provisioning, or build configuration.

Use the Expo plugin

Expo published an Expo plugin that gives Codex Expo-native guidance for Expo Router, native UI, forms, navigation, animations, data fetching, NativeWind setup, Expo modules, dev clients, deployment, upgrades, and Codex Run action wiring.

Use it when Codex is building new Expo screens, adding packages, wiring API calls, preparing a dev client, or getting an app ready for TestFlight, App Store, Play Store, or EAS Hosting.

Optionally, add the Expo MCP Server when the task needs current Expo documentation lookup, compatible package installation, EAS build and workflow operations, screenshots, simulator interaction, React Native DevTools, or TestFlight data.

Iteration process

  1. Ask Codex to inspect the repo and confirm whether it is a new Expo app or an existing Expo project.
  2. Start with Expo Router and Expo Go, and use npx expo install when adding Expo packages.
  3. Ask Codex to build one complete workflow with native-feeling navigation, loading states, empty states, and error states.
  4. Verify on the fastest available path, such as Expo Go on a device or a simulator, then move to a dev client or EAS only when needed.

Suggested follow-up prompt

官方提示词

英文原文 · 可复制后按实际材料修改

Use the Expo plugin to add the following [feature/screen/flow] to this app:

[describe one feature, screen or user flow]

Constraints:

- Keep Expo Router as the routing layer.
- Use Expo-compatible package installs.
- Test with Expo Go first.
- Move to dev client or EAS only if this feature requires it.

After implementing, tell me the exact run path you used and what you verified.