Expo: your new best friend!

mobile apps made easier

Don Namgyal
3 min readJun 30, 2020

What is Expo?

Expo is a framework for universal React applications. It is a tool that allows you to quickly build native iOS, Android, and web apps from the same code Javascript/Typescript codebase. A perfect tool as you get started to build, test, deploy, and iterate your app. Another added bonus is that you don’t need to use Xcode or Android Studio to build the apps.

How it works

We need 2 things to get started with Expo, the Expo CLI for development, and the Expo client app for either iOS or Android.

Getting started with Expo

We use Expo just as we did create-react-app. First, we install the Expo CLI using npm or yarn. Once installed, you can create a new project using expo init my-project.

Since Expo is built around React Native, which is specifically designed for mobile devices, we need to use mobile components. We have to specifically import the components we use. In our codebase, we replace <div> tags with <View>, <p> tags with <Text> in our code. If you’re coming with a react background, you should not have any trouble.

When you're ready to view your project, you can use either npm start or expo start command. To view your project in the browser, you simply go to the localhost address. To view how the apps look on your mobile devices, you can install a simulator/emulator or use the Expo client app. You can either register for an Expo account and track the project via your account or use the app to take a picture of the QR code.

When you’re ready to publish, you can run the expo publish command which will upload two versions of your code to Expo’s CDN servers. When you’re ready to deploy them to the app store, you can view the guide here.

Pros and Cons

Pros:

  1. The project setup is easy and takes minutes.
  2. You can view the project live as you work on it.
  3. Sharing the app is easy, you don’t have to send the whole .apk or .ipa file.
  4. You don't need Android Studio or Xcode to run the app.
  5. Expo supports many device API’s.
  6. You can decide to switch to native build at any given point via ExpoKit.

Cons:

  1. Large file sizes. The standard Hello World app is 25MB.
  2. You can’t add native modules unless it is supported by Expo.
  3. When using ExpoKit, you are constrained to the react-native version supported by ExpoKit at the time.
  4. Once the app is ejected from Expo, debugging becomes a hassle due to different languages and libraries.

If you’re looking to get an MVP out there, you can’t go wrong with Expo. Documentation can be found here.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response