How to create a React Native Project

There are two ways to install and get started with a react native project. They are:

  1. React Native CLI

  2. Expo Go CLI

Using React Native CLI

React Native CLI is the official way to build a project. It gives you full access to your project as well as configurations. To get started, run the code in your terminal.

npx react-native init my-app-name

After installing, go into the directory and run npm start

cd my-app-name
npm start
// For android
npm run android
// For iOS
npm run ios

Using Expo Go CLI

Expo GO CLI is a command-line tool that is the primary interface between a developer and other Expo tools that helps you minimize configuration while giving you all the necessary build to create your project.

Note: You can eject from an existing Expo Go project to React Native CLI

First, we need to install the expo-cli on our machine. To do that, run the code in your terminal.

npm install expo-cli -g
// or
yarn install expo-cli -g

Now, it is time to install expo go:

npx create-expo-app my-app-name
// To get expo template
npx create-expo-app --template

After installing, go into the directory and run npm start

cd my-app-name
npx expo start

For more info about their respective tool setup, please refer to their documentation.

Requirements

  • Node.js

  • Android Studio

  • Code Editor