What is React JS?

What is React JS?

React is a JavaScript library for building user interfaces. Sound confusing right? let me write something new.

Extremely popular, declarative, component-based, state-driven, JavaScript Library for building user interfaces and created by Facebook. Nowadays Facebook is also called Meta. Sound too much confusing, let me extract everything from top to bottom.

Component-

Components are the building blogs of the user interface in React.

We build complex UI by building and combing multiple components.

Declarative

We describe components and how they work using a declarative syntax called JSX.

JSX: a syntax that combines HTML, CSS, and JavaScript as well as refreshing other components.

Declarative telling reacts to what a component should look like, based on current data/state.

So we can say react is an abstraction away from the DOM. we will never touch the DOM. If you never touch the DOM, then how does React update the UI? That's where the concept of state comes into play.

State-Driven

whenever the state changes we manually update the state in our app. so and react will then automatically re-render the user interface to reflect the latest state. In other words,

React, reacts to state changes by re-rendering the UI.

JavaScript Library

Is React a Library or a Framework?

React is a library because react is only a view of Layout.

  • Many large companies have adopted React JS. Ex Paypal, Tesla, Netflix, IMDb, Airbnb.

  • A huge job market with high demand for react developers.

  • Large and vibrant react developer community.

  • And third-party library ecosystem.

Created by Facebook

React was created in 2011 by Jordan Walke. an engineer working at Facebook at the time.

The resolution will happen when react is open source in 2013 and has since completely transformed front-end web development.