React. js is an open-source JavaScript library that is used for building user interfaces specifically for single-page applications. ... 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.
npx create-react-app my-app
cd my-app
npm start
Functional Components: In simple words, Functional components are javascript functions. ...
Class Components. ...
Higher-Order Components. ...
Dumb Components. ...
Smart Components. ...
Presentational Components. ...
Container components.
The simplest way to define a component is to write a JavaScript function:
function Welcome(props) { return
; }This function is a valid React component because it accepts a single “props” (which stands for properties) object argument with data and returns a React element. We call such components “function components” because they are literally JavaScript functions.
You can also use an ES6 class to define a component: