How to install React JS on Windows 10 | v18.2.0 |

How to setup React JS in Windows 10

setup react js

What is React JS?

React is an open-source, free JavaScript library that was introduced by Meta formerly known as Facebook. React JS is used as a frontend technology to develop single-page applications (SPA) but keep in mind that it is not a requirement. In ReactJS, we use components to build our applications. React JS uses the Babel compiler to translate JavaScript code to browsers.

 What are the Components?

In JavaScript we have functions and in React JS we have components (that is functions == components). Components serve the same purpose as functions but in a different manner and as a result, return HTML (in React JS we use JSX instead of plane HTML). Components are of two types, one is Class-based components and the second one is Function-based components.

You may also like: 

Prerequisite: 

  • Node JS must be installed on the device. Visit here for the installation guide on How to set up Node JS.
  • A text editor or command prompt or PowerShell.
  • Internet.

How to setup React JS on Windows 10 machine

How to install React JS

We have three methods to install React JS on Windows 10 machines just follow the given instructions.
  • Common for all the three methods: Navigate to the folder where you want to install the react app and then open CMD or PowerShell or VSCode terminal here.
  • 1st method: Inside the cmd terminal, type the following command "npx create-react-app appname_in_smallLetters".
  • 2nd method:  Inside the cmd terminal, type the following command "npm init create-react-app appname_in_smallLetters".
  • 3rd method:  Inside the cmd terminal, type the following command "yarn create-react-app appname_in_smallLetters". Remember, Yarn has to be installed before use.
Do note that "appname_in_smallLetters" is only needed when you want to create a folder, it can be replaced by dot "." if you already created a folder previously.

How to run a React app?

  • If you have created react app with the help of npm or npx use "npm start" in the terminal to run your react app in the browser.
  • If you have installed the same with yarn then write "yarn start" to run your react app in the browser.
I hope this article was helpful to you.
Thank you.

Comments

Popular posts from this blog

How to install MySQL Workbench | Windows 10

How to install C and C++ | MinGW | Windows 10

How to install Python on Windows 10