How to create a new react native project

To create a new React Native project, you can follow these steps:

Method 1: Using the React Native CLI

  1. Open your terminal or command prompt.
  2. Install the React Native CLI by running the following command: npm install -g react-native-cli (or yarn global add react-native-cli if you're using Yarn).
  3. Create a new project by running the following command: npx react-native init <projectName> (replace <projectName> with the name of your project).
  4. Follow the prompts to choose the project template and configuration options.
  5. Once the project is created, navigate to the project directory by running cd <projectName> (replace <projectName> with the name of your project).
  6. Run npm start (or yarn start) to start the development server.
  7. Open the project in your preferred code editor and start building your React Native app.

Method 2: Using Expo

  1. Open your terminal or command prompt.
  2. Install Expo by running the following command: npm install -g expo-cli (or yarn global add expo-cli if you're using Yarn).
  3. Create a new project by running the following command: expo init <projectName> (replace <projectName> with the name of your project).
  4. Follow the prompts to choose the project template and configuration options.
  5. Once the project is created, navigate to the project directory by running cd <projectName> (replace <projectName> with the name of your project).
  6. Run expo start to start the development server.
  7. Open the project in your preferred code editor and start building your React Native app.

Additional Steps

Tips and Variations