This tutorial I am going to focus on how to install and build your first React Native application.
There are two methods you can follow to develop React Native app. If you are very new to mobile development and not familiar with setting up mobile development environment, I would suggest to start with Expo CLI. Expo is a set of tools to build React Native application. It has may features; you have to select suitable features to develop your app in minutes. You need only a recent version of Node.js and a phone or emulator. If you want to test your React Native application on your web browser before installing any tools, you may use Snack.
If you are familiar mobile developer from other languages
and want to try out React Native, you may try out React Native CLI. For that
you need to install either Xcode for iOS or Android Studio for Android OS.
If you are a beginner, my personal suggestion is to go for
Expo CLI and familiar with the React Native features and concepts. Actually,
using Expo CLI, you can develop production level application. But when you move
forward there might have some limitation when your application grow to access
very hardware specific features. For example, if your application wants to read
NFC card, get some data from Bluetooth enabled devices…etc you might want to go
for React Native CLI rather Expo CLI. In my own experience I have developed
Expo application for many projects which read mobile device network connection,
camera, Wi-Fi connection and many more. Most important feature is if you write
your Expo app in a such way that you may use same code for iOS and Android OS
as it is. But in React Native CLI most of the time you need to some slight
modifications to build for iOS and Android OS.
Method 1: Expo CLI
Prerequisite is to install Node 12 LTS or greater on your
machine. You can use npm or yarn command to install the Expo CLI command line
utility:
npm install -g expo-cli
yarn global add expo-cli