If you’re keen to learn all-things React Native (including the types of things you can build), without the need to deal with dependency settings, links and compatibility issues; we recommend giving this tutorial a try.
One of our favourite features about Expo? If you don’t have a Mac but have an iPhone, you can build on a Windows/Linux PC and test it on your own device; something that is almost impossible to achieve using just React Native.
Make sure that you have Node.js installed.
Install the Expo client on your computer by running the command below:
npm install expo-cli --global
Install the Expo client on your device:
Once you have the initial settings in place, you can start a new project.
Write the below command in the terminal:
expo init my-project && cd my-project
Expo will begin by offering some preset options:
We recommend using the 'tabs' option in this tutorial so that the React-Navigation comes pre-configured. After a little practise, feel free to set the React-Navigation however your choose.
Now run ‘npm-start’:
A QRCode will be shown in the terminal like so:
As it states in the example above, if you’re using Android, scan the QRCode with the Expo app. If you’re using iOS, scan it with your camera:
If you’ve followed the above steps, you should have a fully operational template to start working with. Expo provides a huge number of API’s to work with (without the need for new dependencies), so there’s no excuse to not start experimenting. We’ve listed some of our favourites for you to try below:
- Admob (Advertisement system by Google)
- AppleAuthentication (iOS only)
- Audio (Play and record audio)
- BarCodeScanner (We’ve got a tutorial for one of these here)
- Payments (Apple Pay for iOS and Stripe for both iOS and Android)
After exploring Expo, it’s worth trying out some things in React Native without relying on Expo entirely. We’ve got a full list of tutorials you can follow here.