Both, React Native and ReactJS were created by Facebook. React Native is being used in thousands of apps, full list can be found here but it's likely you've already used it in one of these apps:
Setting up the development environment
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)
This will start a development server for you:
Running your React Native application
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
Modifying your app
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.
To connect with me
Please check my Github, LinkedIn and follow me on Twitter.
Thanks for reading!
Top comments (2)
Cool guide works like a treat thanks for posting.
Thank you @andrewbaisden