Skip to content

Expo Development Patterns

Your EAS build is green, the app runs in Expo Go on your phone, and then a teammate adds react-native-vision-camera and Expo Go silently stops loading the app. Half your prompts assume the managed workflow, the other half assume a development build, and the AI keeps generating code for whichever one it guessed. The fix is not “use AI more” - it is giving the AI the two facts that actually constrain an Expo project: which SDK you are on, and whether you are running Expo Go or a dev build.

This recipe shows the Expo workflows that survive contact with EAS, app store review, and SDK upgrades, driven through Cursor, Claude Code, and Codex.

  • A scaffolding prompt that pins the Expo SDK and the workflow type so the AI stops guessing
  • A copy-paste prompt for an auth-protected Expo Router tab layout that handles the redirect race
  • A NativeWind setup prompt that produces a typed theme, not just className strings
  • An EAS Build + OTA-update prompt wired into GitHub Actions via the GitHub MCP server
  • A “When This Breaks” map of the failure modes that actually cost you a day: SDK upgrades, Expo Go incompatibility, EAS credentials, and OTA runtime mismatches

The single biggest lever on output quality is naming the SDK version and the workflow type up front. As of June 2026 the current line is Expo SDK 56 (React Native 0.85, React 19.2, Hermes as the default engine). Pin it.

Open Cursor in an empty folder, enter Agent mode (Cmd/Ctrl + I), and paste:

Scaffold a new Expo SDK 56 app using npx create-expo-app@latest with the TypeScript template. Add Expo Router (file-based routing), NativeWind v4 for styling, and configure a development build (not Expo Go) because we will add native modules later. Set up eas.json with development, preview, and production profiles.

Agent mode runs the CLI, edits app.json/eas.json, and shows a diff before applying. Review the eas.json profiles before accepting.

File-based routing is where most Expo time goes, and the auth-gate redirect is where most bugs live: redirect before the layout mounts and you get a “navigate before mounting the Root Layout” warning; redirect in render and you flash protected content for a frame.

The AI should produce a tree like this and the matching layout files:

app/
_layout.tsx // SessionProvider + Stack.Protected guard
(auth)/
_layout.tsx
login.tsx
(tabs)/
_layout.tsx // Tabs
index.tsx
profile.tsx

How to evaluate the output: confirm it keeps the splash screen up with SplashScreen.preventAutoHideAsync() until SecureStore resolves, and that the gate uses Stack.Protected (SDK 53+) rather than a useEffect + router.replace, which causes the redirect flash. If you see router.replace inside a render path, send it back with “move the guard out of render.”

The trap with NativeWind prompts is getting a wall of className="bg-blue-500" with magic values. Ask for a typed theme so colors come from one place.

Reject the first draft if the button hard-codes hex values instead of bg-primary - the whole point is that a rebrand is a one-file change.

This is where the GitHub MCP server earns its place. Without it, the AI writes a plausible-looking eas-build.yml, you paste it, push, and discover the secret names are wrong. With the GitHub MCP server connected, the agent reads your actual repo - existing workflows, secret names, branch protection - and writes CI that matches.

Setup is identical across all three tools (it is the official remote GitHub MCP server):

Add to .cursor/mcp.json:

{
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/"
}
}
}

Expo notifications have one production gotcha the AI routinely skips: you must send the push token to your backend and handle the notification-tap deep link, not just request permission.

Mobile is where AI confidence and reality diverge the most. The four failure modes below are the ones that actually cost a day:

  • SDK upgrade breakage. npx expo install expo@^56 is the easy part; transitive native deps and config plugins are not. Run npx expo-doctor and paste its full output into the AI with: “We just upgraded to SDK 56. Here is expo-doctor output. Fix each version mismatch using npx expo install --fix, and flag any third-party package with no SDK 56 support.” Do not let the AI hand-edit versions in package.json - expo install resolves the compatible ranges.
  • “It works in Expo Go but not the dev build” (or vice-versa). This is almost always a module that is not in Expo Go, or a config plugin that only applies during prebuild. Tell the AI which environment fails and ask it to check whether the module requires a development build and a config plugin entry in app.json.
  • EAS credentials and provisioning. When eas build fails on signing, paste the build log. The usual culprits are an expired Apple distribution cert or a missing push key. Ask the AI to interpret the specific EAS error rather than regenerating credentials blindly - eas credentials is interactive and destructive if misused.
  • OTA runtime mismatch. If an eas update “succeeds” but devices never pick it up, the runtimeVersion of the update does not match any installed build. Have the AI diff the update’s runtime version against your latest store build before assuming the update pipeline is broken.