Introduction to React and Setup Environment

Here, we will have a brief introduction of react and how we can setup the environment to create a react application.

Introduction to React:

React is a JavaScript library used for building user interfaces for web applications. It is mainly used to build a single page web applications. We can also build multipage react application as well.

 

Setup Environment: 

Step 1:

First we need to install Node.js . Here is the link using which you can download and install Node.js (nodejs.org)

Step 2:

Once Node.js is installed successfully, we can start creating react app using npx.

Step 3:

Download and install Visual Code Editor. It makes it very easy to develop react app using this editor.

Here is the link to download Visual Studio Code – Code Editing. Redefined

Step 4:

Open VS Code and open the folder in which you want to create the application. Open terminal using ‘ Ctrl + ` ‘ shortcut.

Step 5:

Enter the below code in terminal and it will create a new react app. Here “sampleapp” is the application name. We can change the name as per our project requirement.

npx create-react-app sampleapp
Step 6:

Once the above process it completed, the new react app is ready to run. Before that we need to select the application directory. Use the below command to select the directory

cd sampleapp
Step 7:

To run the app enter the below code in terminal

npm start
Note:

To check the currect react js version you can use the below command.

npm view react version

 

Submit a Comment

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

Footer Logo

Subscribe

Select Categories