This page will help you install and build your first React Native app.
If you are new to mobile development, the easiest way to get started is with Expo CLI. Expo is a set of tools built around React Native and, while it has many features, the most relevant feature for us right now is that it can get you writing a React Native app within minutes.
You will only need a recent version of Node.js and a phone or emulator.
npm install -g expo-cli
Then run the following commands to create a new React Native project called "NewProject":
expo init NewProject
However, I received this error at the very beginning
ERROR: Node.js v12.10.0 is no longer supported. expo-cli supports following Node.js versions: * >=10.13.0 <11.0.0 (Maintenance LTS) * >=12.13.0 <13.0.0 (Maintenance LTS) * >=14.0.0 <15.0.0 (Active LTS) * >=15.0.0 <16.0.0 (Current Release)
After throwing some errors trying to install
node-v15.5.0 as supported version, and system fails to overwrite the current
version v12.10.0, this fix a problem:
nvm install node --reinstall-packages-from=$(nvm current)
On Android, use the Expo app to scan the QR code from your terminal to open your project.
On iOS, use the built-in QR code scanner of the Camera app. Running on and starting the Simulator Guides can be found here
Now that you have successfully run the app, let's modify it by opening App.js in your text editor and edit some lines. The application should reload automatically once you save your changes.
Congratulations! You've successfully run and modified your first React Native app.
Thanks for reading!