DEV Community

Cover image for What is React ? How to set up React?
yashvi2001
yashvi2001

Posted on

What is React ? How to set up React?

What is React ?

It is an open source front-end library developed by Facebook which helps for building the UI components. It’s used for handling the view layer for web and mobile apps. React also allows us to create reusable UI components.
React allows developers to create large web applications that can change data, without reloading the page. The main purpose of React is to be fast, scalable, and simple. It works only on user interfaces in the application.

Why React?

React is very simple and easy to learn. The component-based approach, well-defined lifecycle, and use of just plain JavaScript make React very simple to learn, build a professional web. React uses a special syntax called JSX which is a mixture of JavaScript and HTML.
React allows us to compose complex UIs by writing a small piece of code which is called Component.

Prerequisites

  • HTML
  • CSS
  • JavaScript

Technical Requirement

  • Nodejs installed
  • A preferred Code Editor (Atom , VS code recommended)

Setup

We can setup the react app by :-

npx

npx create-react-app <project-directory>
cd <project-directory>
npm start

yarn

yarn create-react-app <project-directory>
cd <project-directory>
yarn start

npm

npm init react-app <project-directory>
cd <project-directory>
npm start

Then it runs the app in development mode.
View the app in

http://localhost:3000

Your First React App is ready!

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.