Expo, Prebuild and the Bare Workflow

Article · 2:00

Three ways to run React Native, what each one costs, and why the old advice to "eject" is out of date.

For years the advice was to start with Expo and eject when you needed something it did not support. That advice is obsolete, and following it today will cost you work.

The managed Expo workflow means you have no ios or android folder in your repository. Expo generates them when it builds. You write TypeScript, you use Expo's modules for native features, and you never open Xcode. This is where to start and, for a large number of apps, where to stay.

Expo Prebuild, also called Continuous Native Generation, is the part that changed everything. Your native folders are generated from your app.json and a set of config plugins, on demand, and then thrown away. You get full native capability - any library, any custom native code - without the native folders being something you maintain. When a library needs an entry in Info.plist or a permission in the Android manifest, a config plugin writes it during the build.

The bare workflow is a checked-in ios and android folder that you own and edit by hand. You need it when you must make native changes that no config plugin expresses, or when React Native is being embedded into an existing native app. The cost is that every React Native upgrade becomes a manual merge of those folders - which is the single biggest source of upgrade pain in the ecosystem.

Start managed. Reach for Prebuild when you need a native capability. Go bare only when something concrete forces you to.

# Managed: no ios/ or android/ folder exists. This is the default.
npx create-expo-app@latest my-app
npx expo start

# Prebuild: generate the native folders from app.json and config plugins,
# build, and treat the folders as build output rather than source.
npx expo prebuild --clean       # regenerates both platforms from scratch
npx expo run:ios                # builds and runs a real native binary
npx expo run:android

# A config plugin writes the native change for you. This in app.json:
#
#   "plugins": [
#     ["expo-camera", { "cameraPermission": "We use the camera to scan codes." }]
#   ]
#
# produces NSCameraUsageDescription in Info.plist and the matching Android
# permission - every time the native folders are regenerated.

# Bare: you keep ios/ and android/ in git and edit them yourself. Only when
# something concrete forces it, because every upgrade is now your merge.