Why we use it
Plain React Native needs a lot of native configuration before you see one screen. With Expo you run one command, scan a QR code and your app is on your phone. It also includes ready-made modules for the camera, location and sensors, which you need for the coursework's device feature.
Why not the alternatives?
- React Native CLI
- Full control, but you must configure Android Studio, Gradle and Xcode before running anything. Expo does this for you and still lets you add native code later.
The commands you’ll use most
| Command | What it does |
|---|---|
npx create-expo-app@latest | Create a new project |
npm run reset-project | Clear the starter template so you get a blank app |
npx expo start | Start the dev server and show the QR code |
npx expo install <pkg> | Install a library at the version that matches your Expo SDK |
Important
For libraries with native code, use npx expo install rather than npm install. It picks the version that works with your Expo SDK.
Common problems
"npxexpo" is not recognized
Fix
It is two words: npx expo start.
Strange bundling errors after installing a package
Fix
Clear the cache, then check versions.
Run
npx expo start --clearnpx expo-doctornpx expo install --fix