React JS Tutorial - Installation
In this tutorial, we will learn how to install and create a React JS app. React is a JavaScript library for building user interfaces, maintained by Facebook and a community of individual developers and companies. It can be used as a base for developing single-page or mobile applications, and allows us to create reusable UI components.
Installing Node JS
To create a React app, you first need to install Node JS. Go to nodejs.org and download the installation package. Once installed, you can proceed with the next steps.
Installing Create-React-App
Next, install Create-React-App by running the following command in your command prompt:
npm install -g create-react-app
This command will install Create-React-App globally, which may take a few minutes.
Creating a React App
Once Create-React-App is installed, you can create a new React app using the following command:
npx create-react-app myapp
Here, npx is a tool for running npm packages. Press Enter to create the React app, which may take a few minutes.
Running the React App
After the installation process is complete, switch to the project directory by typing:
cd myapp
Then, run the React app using the following command:
npm start
The app will run on localhost:3000. To verify, open your browser and type localhost:3000 in the URL bar. You should see the React app running.
That's it! You have successfully created a new React app using the Create-React-App package.