Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Environment Setup  ›  Lesson

Expo and the React Native CLI

Expo 12 minExpo is the recommended way to start a React Native app, and development builds remove most of its old limits; the bare Community CLI suits projects that need full native control.

Expo and the React Native CLI

Sprout needs a project folder before it needs a single screen. There are two ways to create one, and they sound like rivals: Expo and the React Native Community CLI. Choosing well on day one saves a week of setup pain.

The rule

Start with Expo; reach for the bare CLI only for a proven need.

Expo is a framework and set of tools built on top of React Native. It gives you:

  • a project generator (npx create-expo-app@latest),
  • a development server and a phone app, Expo Go, that runs your project by scanning a QR code,
  • ready-made libraries such as expo-camera, expo-notifications and expo-image,
  • cloud build and update services (EAS) so you can produce store builds without a Mac for iOS.

The React Native documentation itself recommends starting new apps with a framework like Expo.

The React Native Community CLI creates a "bare" project with the ios/ and android/ folders checked in:

npx @react-native-community/cli@latest init Sprout

With it, you install Xcode and Android Studio yourself, manage native build files by hand, and have full control over every native setting. Teams that are adding React Native to an existing native app often need that control.

The tradeoffs of Expo used to be large; today they are small. Expo Go only contains the native modules Expo ships, so a library with custom native code will not run in it. The fix is a development build: your own version of the Expo Go app that includes the extra native code. You keep Expo's tools and still add any native library. Expo can also generate the native folders for you with npx expo prebuild when you need to look inside them.

The shortcut

Ask one question: "Do I have a specific native requirement Expo cannot meet today?" If you cannot name one, choose Expo.

Choosing a setup for SproutStep 1 of 4
  1. List native needs

    Sprout needs notifications, images and local storage.

The trap is picking the bare CLI "just in case". You pay the setup cost now for a need that may never arrive, and with development builds you could add it to Expo later anyway.

Drills

Answer fast — trust the rule.

quick drill

What is Expo Go?

quick drill

Sprout adds a library with its own custom native code. Why does it fail in Expo Go?

quick drill

What is the fix when you need custom native code but want to keep Expo's tools?

quick drill

Which situation most clearly suits the bare React Native CLI?

Remember

  • Start with Expo; use the bare CLI only for a named native need.
  • Expo Go runs only Expo's modules; a development build adds your own.
  • Trap: choosing the harder setup "just in case".

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainExpo or bare CLI?

A team wants to build a fitness app that uses the camera, notifications and one third-party library with custom native code. Recommend a setup and explain how they handle the custom native library.