0% found this document useful (0 votes)
9 views2 pages

To Start With React Native

This document provides a step-by-step guide to setting up React Native, recommending the use of Expo CLI for beginners. It outlines the prerequisites, installation process, project creation, and running the app on devices. Additionally, it describes the project structure and alternative setup using React Native CLI for more advanced users.

Uploaded by

laibakhann6785
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

To Start With React Native

This document provides a step-by-step guide to setting up React Native, recommending the use of Expo CLI for beginners. It outlines the prerequisites, installation process, project creation, and running the app on devices. Additionally, it describes the project structure and alternative setup using React Native CLI for more advanced users.

Uploaded by

laibakhann6785
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

React Native

To start with React Native, follow these steps:

1. Install Prerequisites
Before setting up React Native, ensure you have:
✅ Node.js (Download from Node.js)
✅ npm (comes with Node.js) or yarn (optional)
✅ Expo CLI (for an easy setup) or React Native CLI (for full control)

2. Install Expo CLI (Recommended for Beginners)


Expo simplifies the setup and allows you to run React Native apps quickly.
npm install -g expo-cli

3. Create a New React Native Project


Use Expo to create your project:
npx create-expo-app MyApp
cd MyApp
npm start

4. Run the App on Your Device


For Android: Install the Expo Go app from the Play Store.
For iOS: Install Expo Go from the App Store.
Scan the QR code that appears in your terminal with your device camera.

Alternative: React Native CLI (More Advanced Setup)


If you want to use React Native CLI instead of Expo:
npx react-native init MyApp
cd MyApp
npx react-native start
React Native
Then, open another terminal and run:
npx react-native run-android # For Android
npx react-native run-ios # For iOS (Mac only)

1. Understand the Project Structure


Your React Native project will have a folder structure like this:
📂 MyApp/
├── 📁 node_modules/ (packages installed via npm/yarn)
├── 📁 android/ (Android-specific code & settings)
├── 📁 ios/ (iOS-specific code & settings)
├── 📁 assets/ (images, fonts, etc.)
├── 📁 components/ (your custom UI components)
├── 📄 App.js (Main entry point of your app)
├── 📄 package.json (Lists dependencies & scripts)
├── 📄 babel.config.js (Babel settings for React Native)

2. Run Your App on an Emulator or Physical Device


For Expo: Run
npm start
Scan the QR code using Expo Go (on iOS/Android).

For React Native CLI:


Android: Run an emulator (npx react-native run-android)
iOS: Use Xcode (npx react-native run-ios) (Mac only)

You might also like