What is React JS

what is react js


React is a Javascript library used for building fast and interactive user interfaces. It is developed by Facebook in 2011. Today, React is very popular .

React is a Javascript library used for building fast and interactive user interfaces.

 React is used to build single-page applications or mobile applications. You can create complex user interfaces using small isolated pieces of code called components.


Components in React

Components are building blocks of a React App. A component represents a piece of User Interface like buttons, textbox, etc. It is a javascript function or class which accepts properties(props) and returns a react element that describes how a section of UI should appear.

A Component is a javascript function or class which accepts properties(props) and returns a react element that describes how a section of UI should appear.

Props and State

There are two types of "modal" data in React:

  • props and,
  • state

Props: Props are used to send data to the component, it is equivalent to the arguments of the javascript function. Parent component can pass data to the child component using props.

State: State is a javascript object that is initialized and managed by the component. It is like a data store for the react component.