Section 1 · The Mental Model
Starting a Project with Expo
17 min4 min readFill in the blanks
Lesson at a glance
Create the Trailhead project with create-expo-app, run it on your phone and a simulator, add libraries safely, and know when Expo Go stops being enough.
- 1Create Trailhead
- 2Run it on a device
- 3Adding libraries the Expo way
- 4Expo Go vs a development build
- 5JavaScript changes vs native changes
No video here — just the real thing: a written lesson, runnable examples, a quiz and practice.
The React Native docs recommend starting new apps with a framework, and the framework they point to is Expo. Expo gives you the project template, the dev server, a library of device APIs (camera, location, storage, notifications) that all work with the same SDK version, and a cloud service to build and ship. You can still write native code when you need to; you’re not locked in.
Create Trailhead
You need Node.js (an active LTS release) and a phone or a simulator. Then:
npx create-expo-app@latest trailhead
cd trailhead
npx expo startThe default template comes with TypeScript and Expo Router already configured. The parts you’ll touch first:
trailhead/
src/app/_layout.tsx root layout: wraps every screen (navigation lives here)
src/app/index.tsx the first screen, at route "/"
src/app/explore.tsx a second example screen, at "/explore"
assets/ icons, splash image, fonts
app.json app name, icons, bundle ids, plugin settings
package.json dependencies, including "expo" (the SDK version)Every file in src/app becomes a screen. You’ll learn how routing works in section 3; for now, open src/app/index.tsx, change some text, and save.
Run it on a device
npx expo start launches Metro, the JavaScript bundler, and prints a QR code. You have three ways in:
- Your phone with Expo Go. Install Expo Go from the App Store or Play Store, then scan the QR code (Camera app on iOS, Expo Go itself on Android). The phone and computer must reach each other on the network.
- iOS Simulator (macOS with Xcode): press
iin the terminal. - Android Emulator (Android Studio): press
a.
While Metro runs, a few keys earn their place in muscle memory: r reloads the app, m opens the in-app dev menu, and j opens React Native DevTools. Saving a file triggers Fast Refresh, which swaps in the new code without losing component state.
Adding libraries the Expo way
Each Expo SDK release targets one React Native version, and native libraries have to match it. So instead of npm install, you add libraries with:
npx expo install expo-location expo-image-pickernpx expo install looks up the version that’s known to work with your SDK and installs that one. For pure JavaScript packages (a date library, say) it falls back to your package manager, so you can use it for everything.
When something feels off after an upgrade, run the health check:
npx expo-doctorIt reports mismatched versions, duplicate native modules and config problems.
Expo Go vs a development build
Expo Go is an app from the store with a fixed set of native modules baked in: the Expo SDK and a handful of popular libraries. Your JavaScript is loaded into it. That’s perfect for learning, and it’s why you could run Trailhead seconds after creating it.
Its limits show up quickly in real projects:
- It can only include native code that was compiled into it. A library outside that set won’t load.
- It supports one SDK version at a time (usually the latest), so an older project may not open in it.
- Some features need your own app identity, such as push notifications and custom URL schemes.
A development build is your own app, with your app name, icon, bundle identifier and native modules, plus the same dev tools (Fast Refresh, dev menu, DevTools). You create one locally:
npx expo run:ios
npx expo run:androidor in the cloud, without Xcode or Android Studio on your machine, using EAS Build (section 5). After that, npx expo start serves JavaScript to your development build exactly as it did to Expo Go.
A sensible default: learn and prototype in Expo Go, then switch to a development build the first time you need something Expo Go doesn’t have. For Trailhead you’ll stay in Expo Go until section 4.
JavaScript changes vs native changes
This distinction runs through the whole course, so name it now. JavaScript changes (components, styles, logic) reach a running app through Fast Refresh in development and, later, through over-the-air updates in production. Native changes (adding a native module, changing permissions text, the app icon or the bundle identifier in app.json) need a new binary. When a change “doesn’t show up”, ask which kind it was.
Next you’ll replace the template’s example screen with Trailhead’s first real UI, using React Native’s core components.
Key takeaways
npx create-expo-app@latestcreates a TypeScript project with Expo Router and file-based routes insrc/app.npx expo startruns the Metro dev server; scan the QR code with Expo Go, or pressiorafor a simulator or emulator.- Install libraries with
npx expo install, which picks the version that matches your Expo SDK. - Expo Go is a learning sandbox with a fixed set of native modules; a development build is your own app with dev tools, and real projects move to one early.