Step 1: Install create-react-native-app
After installing NodeJS and NPM effectively in your system you can continue with the installation of create-react-native-app
Step 2: Create a Project
Look through the required folder and create a new react-native project as follow.
Step 3: NodeJS Python Jdk8
Ensure you have Python NodeJS and jdk8 installed in your system if not, install them. Moreover, it is also recommended to install the most recent version of yarn to avoid certain issues.
Step 4: Install React Expo CLI
You can install react-native command-line interface on npm, utilizing the install -g react-native-cli command as follow:
Why use Expo?
You should consider utilizing Expo for a React Native app because it handles a lot of hard tasks itself and delivers smooth APIs that work with a React Native application outside the box. It is open-source and is free of cost. It gives a client app and by downloading it from the relevant stores grounded on the mobile platform your device runs, you can easily test apps on real devices.
That said, Expo also has some disadvantages. For example, Expo’s API currently does not support many features like Bluetooth. It works perfectly with the camera, google maps, location tracking, analytics, pop-up messages and so on. Distributing an Expo app is easy and simple as well. You can complete the procedure just by running the command expo publish and it will handle the build procedure and other tasks by running them behind the scene. It has a dedicated store where you can publish applications for others to use. Quite helpful in prototyping.
Side Note: Why not Create-React-Native-App?
Just like React, React Native has its standards that rely upon Expo for a faster development process, called create-react-native-app. It works with zero build setup just like Expo. Recently, the CRNA project has been amalgamated with the expo-cli project since both are identical in working.
Step 5: Start React Native
To confirm the installation, look through the project folder and try starting the project using the start command.
Step 6: Run Your Project
When Expo’s command-line interface finishes running the package manager, it creates a directory with the name you gave in the above command. Open your preferred text editor/IDE and go to a file called App.js. This is what runs the application. You can test the content of the default application produced by running the following command.
Below is what you will get in your terminal. It runs the bundler which further activates the execution of the app. Contingent upon the OS you are on, you can either use iOS simulator or Android emulator to run this app in development mode. The third choice is to install the Expo client on your real device and scan the QR code as shown.