Curious Minds

Clear answers to science and history questions

How Does React Expo Work? A Clear Guide

· 7 min read · Science

React Expo is a framework and platform that lets you build native iOS and Android apps using React Native, but with a managed workflow that removes most of the setup and configuration work. Instead of dealing with Xcode, Android Studio, or native build files, you write JavaScript and TypeScript, and Expo handles the rest—from running your app on a device to building and submitting it to app stores.

Background: What Expo Actually Is

Expo started as a set of tools around React Native, which itself is Facebook's (now Meta's) framework for writing native mobile apps in JavaScript. React Native compiles your JavaScript into native UI components, but the traditional setup requires you to install Android SDKs, Xcode, CocoaPods, and manage a native project folder. Expo's core idea is to wrap that complexity into a single, unified toolchain.

There are two main parts to Expo:

  • Expo Go – a free app you install on your phone from the App Store or Google Play. It lets you run your project instantly by scanning a QR code, without ever opening a native IDE.
  • Expo SDK – a set of libraries that give you access to native device features (camera, location, notifications, haptics, etc.) through a consistent JavaScript API.

The managed workflow is the default: you don't touch native code. But if you need custom native modules, you can "prebuild" and generate the native projects, then continue using Expo's build services.

How Expo Works Under the Hood

When you run npx create-expo-app, you get a project with a package.json, an App.js or App.tsx entry point, and an app.json configuration file. The key magic is in how Expo serves your JavaScript.

  1. Development server – When you run npx expo start, Expo starts a local server (usually on port 8081) that serves your JavaScript bundle over HTTP.
  2. Expo Go or a dev build – Your phone connects to that server via the same Wi-Fi network. Expo Go loads the JavaScript and runs it inside a native shell that already includes the Expo SDK.
  3. Fast refresh – When you edit your code, the server sends the updated bundle to the device, and the app re-renders in real time without a full reload.
  4. Native modules – When your code calls expo-camera or expo-location, the JavaScript API communicates with the native module that's already compiled into Expo Go (or your dev build) via a bridge.

This is why you don't need Android Studio or Xcode for development: the native side already exists in Expo Go. For production, Expo's cloud build service (EAS Build) compiles your JavaScript along with the native shell into a standalone .ipa or .apk file.

The Two Workflows: Managed vs. Bare

Expo historically had a strict "managed" workflow where you couldn't add custom native code. That changed with the introduction of development builds and prebuild. Now the spectrum is:

  • Fully managed – You only write JavaScript. You can't add arbitrary native modules, but you get automatic updates and the simplest experience.
  • Managed with prebuild – You run npx expo prebuild to generate the native ios and android folders. You can then edit native code, but you lose the ability to use Expo Go (you need a custom dev build).
  • Bare React Native – You start with React Native CLI and add Expo modules manually. This is the most flexible but requires you to manage everything yourself.
  • Most projects start with the managed workflow because it's faster. If you later need a specific native library that Expo doesn't wrap, you can prebuild and continue.

    How to Choose Between Expo and Plain React Native

    For most new apps, Expo is the recommended choice by the React Native team itself (as of recent official docs). Here's a practical guide:

    • Choose Expo if you're a solo developer, a small team, or building a prototype – you'll save days of setup.
    • Choose Expo if you need push notifications, over-the-air updates, or easy app store submission – EAS handles these well.
    • Choose plain React Native if you already have a native codebase, or you know you'll need a very unusual native module that isn't supported by Expo's config plugins.

    There's a misconception that Expo is only for simple apps. That's outdated: many production apps use Expo, including those with complex features like video streaming, AR, and Bluetooth. The limitation is not the framework but the specific native module you need – and if it exists as a React Native library, you can usually add it via a config plugin or a dev build.

    Common Problems and How Expo Solves Them

    Here are frequent pain points in React Native development and how Expo addresses them:

    • Version mismatch – React Native projects often break when upgrading because native dependencies fall out of sync. Expo's SDK bundles all native modules with a tested version, so upgrades are mostly one command: npx expo upgrade.
    • Build failures – Without Expo, you need to configure signing certificates, provisioning profiles, and Gradle settings. EAS Build handles these in the cloud, with a simple JSON config.
    • Testing on a real device – Expo Go lets you test on any phone in under a minute. No USB debugging or cable needed.
    • Push notifications – Expo provides a unified push service that works on both platforms without writing native code. You send a request to Expo's server, and it forwards to APNs or FCM.

    Costs and Safety Considerations

    Expo itself is open-source and free to use. The Expo Go app is free. The main costs come from optional services:

    • EAS Build – free tier with limited monthly builds, then paid plans for more. You can also build locally for free if you have the native toolchains installed.
    • EAS Update – free tier for over-the-air updates, then paid for more bandwidth.
    • Apple Developer Program – required to install on a physical iPhone or publish to the App Store (annual fee).

    Safety-wise, Expo is generally safe because it abstracts away native code that could crash your app. However, you should still follow standard practices: keep your Expo SDK version up to date, use environment variables for secrets (never hardcode API keys), and be careful with permissions – Expo's APIs will prompt users for camera, location, etc., but you must handle denial gracefully.

    Alternatives to Expo

    If Expo doesn't fit your needs, the main alternatives are:

    • Plain React Native CLI – full control, but you manage everything.
    • Flutter – Google's UI toolkit using Dart. It's not JavaScript, but it offers similar cross-platform development with its own set of widgets.
    • Capacitor or Cordova – wrap a web app in a native shell. Good if you're already a web developer, but performance and native feel are worse than React Native.
    • Native development – Swift for iOS, Kotlin for Android. Best performance but double the work.

    Expo is not the only way to use React Native, but it's the most beginner-friendly and the official docs now recommend it for new projects.

    Frequently Asked Questions

    Is Expo Go the same as a production app?

    No. Expo Go is a development tool that includes the entire Expo SDK, which makes your app larger and slower. For production, you use EAS Build to create a standalone app that only includes the modules you actually use.

    Can I use Expo with existing native code?

    Yes, but not directly with Expo Go. You can use the expo prebuild command to generate native projects, then integrate your existing native code. Alternatively, you can add Expo modules to a bare React Native project using npx expo install.

    Does Expo work with TypeScript?

    Yes. The default template for create-expo-app includes TypeScript support out of the box. You can also add it to an existing project by renaming files to .tsx and installing the types.

    Is Expo slower than plain React Native?

    In production, no. Expo builds a native app that runs the same JavaScript as a plain React Native app. The only performance difference is in development, where Expo Go has extra overhead from including all modules.

    Do I need a Mac to use Expo?

    No. You can develop on Windows, Linux, or Mac. However, to build for iOS, you need a Mac or use EAS Build's cloud service, which can build iOS apps from any OS.

    Can I eject from Expo later?

    Yes. The expo prebuild command generates the native projects, and you can continue without Expo's managed services. However, you lose the ability to use Expo Go and some automatic update features.

In this article
  1. Background: What Expo Actually Is
  2. How Expo Works Under the Hood
  3. The Two Workflows: Managed vs. Bare
  4. How to Choose Between Expo and Plain React Native
  5. Common Problems and How Expo Solves Them
  6. Costs and Safety Considerations
  7. Alternatives to Expo
  8. Frequently Asked Questions