Setting Up React

Setting Up React

To get start Setting Up React:

If you have NPM and Node.js installed, you can create a React application by first installing the create-react-app.

Install create-react-app by running this command in your terminal:

C:\Users\Your Name>npm install -g create-react-app

Then you are able to create a React application, let’s create one called myfirstreact.

Run this command to create a React application named myfirstreact:

C:\Users\Your Name>npx create-react-app myfirstreact

The create-react-app will set up everything you need to run a React application.

Run the React Application

Now you are ready to run your first real React application!

Run this command to move to the myfirstreact directory:

C:\Users\Your Name>cd myfirstreact

Run this command to run the React application myfirstreact:

C:\Users\Your Name\myfirstreact>npm start

A new browser window will pop up with your newly created React App! If not, open your browser and type localhost:3000 in the address bar.

The result:

Final Setting up React Output

Leave a Reply

Your email address will not be published. Required fields are marked *