Well, let’s get down to the installation. There seems to be nothing difficult about this, React Native has very understandable documentation. What is required to install React Native and run the application? Fortunately, launching and configuring the toolkit to build your application is straightforward. Important: you need to understand that you must have node.js installed on your computer and npm. All you need is to download an app for your phone called Expo, a code editor and a terminal. This application is available in Google Play and App Store for download. If you do not want to install this application on your phone, then you can also register on the expo.io website, where you will have the opportunity to develop your application through your browser. I want to say right away that when I downloaded this application for the IPhone, to launch it I needed to add a project to “my projects” at expo.io. On Android, everything was easier, since it was enough to scan the QR code, which was kindly generated by the create-react-native-app utility. Our further actions are as follows:
- 1 – go to the terminal and install create-react-native-app globally, if it is not installed, with the command: npm install -g create-react-native-app.
- 2 – then create the project by entering the command: create-react-native-app MyApp;
- 3 – go to the project folder: cd MyApp.
- 4 – run the project: npm start.
It was an easy way to install, there is also React Native CLI Quickstart. This method is a little more difficult for beginners. You will need to install a little more, understand more and prescribe. Let’s say if you are developing on Windows (by the way, Windows do not support development for iOS – pay attention to this), but you can create something for Android. You will need to install using Chocolatey (this is a package manager for Windows), Java Development Kit, Python 2. You can do this using the instructions in the official documentation, just step by step, with all the commands and codes. You also install React Native CLI and, accordingly, Android Studio, then you will need to register some dependencies, environment variables and things like this. I repeat that everything is described in the official documentation, so you can try it if you like this method more.
In this article you have read about two ways to install React Native to start developing your mobile applications. EXPO CLI Quickstart is an easier installation option, because it allows you to launch a project without installing Android studio, that is, you can launch a project directly on your phone, no matter if it is Android or iPhone. Expo СLI sets up a development environment on your local computer and you can write an application in a few minutes. In order to see the result of your work in the browser, you can use snack.expo.io. There you write the code, press the “Tap to Play” button and everything is loaded. I hope the article was interesting, and the presented material is useful for you.