First React App

Table of Contents +

In this article, we will create our first React application from scratch.

Create a New React Project

To create a new React project, we will use Create React App that we have installed in the previous setup guide.

  1. Open Terminal: Open your terminal or command prompt or warp terminal.

  2. Navigate to Your Projects Directory: Use the cd command to navigate to the directory where you want to create your React project. For example:

    Terminal window
    cd path/to/your/projects
  3. Create a New React App: Run the following command to create a new React application named my-first-app:

    Terminal window
    npx create-react-app my-first-app

    This command will set up a new React project with all the necessary files and dependencies.

  4. Navigate into Your Project Directory: Change into the newly created project directory:

    Terminal window
    cd my-first-app
  5. Start the Development Server: Run the following command to start the development server:

    Terminal window
    npm start

    This will open your new React app in your default web browser at http://localhost:3000.

Share & Connect