In this tutorial you will learn about the ReactJS Installation and its application with practical example.
ReactJS Installation
In this article you will learn how to Setup React.js development environment Using Npm, Babel and Webpack. It is not required to use Babel and Webpack in order to used React, but to get most out of the features of ES6, JSX and bundling, we need them.
Installing Node and npm
In order to setup ReactJS development environment, you will need NodeJS and NPM installed, so if you don’t have it installed, check the following instruction to get it installed. If you’ve already have installed Node.js in your system, you can skip this part.
Step 1:- Download the Node.js from the official Node website, link given below –
1 |
https://nodejs.org/en/ |
Step 2:- Run the installer (the .msi file you downloaded in the previous step.)
Step 3:- Follow the installation wizard to install Node.js and npm.
Step 4:- Restart your computer. You will not be able to run Node.js until you start your computer again.
Setting Up a ReactJS Project
Step 1:- Install Create React App , easiest react installer with following command –
1 |
npm install -g create-react-app |
Step 2:- Let’s create a react using following command –
1 |
create-react-app helloworld |
Step 3:- Now, switch to project directory –
Step 3:- Now, type the following command in order to run the server.
1 |
F:\w3adda-react\helloworld>npm start |
Step 4:- Now open the following URL in browser to view the output
http://localhost:3000
Step 5:- You will see the following screen.