Labs ICT
โญ Pro Login

Setting Up React Native

Installing and configuring React Native development environment

Setting Up React Native

Getting started with React Native requires setting up your development environment. Let's walk through the process step by step for both iOS and Android development.

Prerequisites

Before you begin, make sure you have:

  • Node.js: Version 18 or newer
  • npm or yarn: Package manager for installing dependencies
  • Git: For version control

Installation Options


  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚        React Native Setup Options               โ”‚
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚                                                  โ”‚
  โ”‚  Option 1: Expo (Recommended for Beginners)     โ”‚
  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”‚
  โ”‚  โ”‚  npx create-expo-app MyApp           โ”‚       โ”‚
  โ”‚  โ”‚  cd MyApp                             โ”‚       โ”‚
  โ”‚  โ”‚  npx expo start                       โ”‚       โ”‚
  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ”‚
  โ”‚                                                  โ”‚
  โ”‚  Option 2: React Native CLI (Advanced)          โ”‚
  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”‚
  โ”‚  โ”‚  npx react-native init MyApp         โ”‚       โ”‚
  โ”‚  โ”‚  cd MyApp                             โ”‚       โ”‚
  โ”‚  โ”‚  npx react-native run-android        โ”‚       โ”‚
  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ”‚
  โ”‚                                                  โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Using Expo (Recommended)

Expo is the easiest way to get started with React Native. It handles all the native configuration for you:


# Create a new Expo project
npx create-expo-app@latest MyFirstApp

# Navigate to your project
cd MyFirstApp

# Start the development server
npx expo start

Scan the QR code with your phone's camera (iOS) or Expo Go app (Android) to see your app running!

Project Structure


  MyFirstApp/
  โ”œโ”€โ”€ app/              # App screens (Expo Router)
  โ”œโ”€โ”€ components/       # Reusable components
  โ”œโ”€โ”€ assets/          # Images, fonts, etc.
  โ”œโ”€โ”€ node_modules/    # Dependencies
  โ”œโ”€โ”€ app.json         # Expo configuration
  โ”œโ”€โ”€ package.json     # Project dependencies
  โ””โ”€โ”€ tsconfig.json    # TypeScript config

๐Ÿงช Quick Quiz

What command creates a new React Native project?