React Setup

Node.js

Before getting started with React development, ensure you have Node.js installed on your system.

You can download and install it from here.

Creating Our First React App

Open Your Terminal: Navigate to the directory where you want to create your React application.

Create a React Application: Run the following command to create a new React application named my-react-app:

npx create-react-app my-react-app

Alternatively, if you want to create the app in the current directory without specifying a name:

npx create-react-app .

Note: Ensure your folder name doesn't contain spaces or capital letters due to npm naming restrictions.

Navigate to the App Directory: If you specified a folder name while creating the app, enter that directory:

cd my-react-app

Start the Application: Start the React application with:

npm start

This command will launch a development server, and your React application will be accessible in your default web browser.