How does React Work?

React is a JavaScript library created by Facebook.

React is a tool for building UI components.

React creates a VIRTUAL DOM in memory.

Instead of manipulating the browser’s DOM directly, React creates a virtual DOM in memory, where it does all the necessary manipulating, before making the changes in the browser DOM.

React only changes what needs to be changed!

React finds out what changes have been made, and changes only what needs to be changed.

You will learn the various aspects of how React does this in the rest of this tutorial.

React.JS History

Current version of React.JS is V16.8.6 (March 2019).

Initial Release to the Public (V0.3.0) was in July 2013.

React.JS was first used in 2011 for Facebook’s Newsfeed feature.

Facebook Software Engineer, Jordan Walke, created it.

The create-react-app version 2.0 package was released in October 2018.

Create-react-app version 2.0 supports Babel 7, webpack 4, and Jest23.

Why learn ReactJS?

Today, many JavaScript frameworks are available in the market(like angular, node), but still, React came into the market and gained popularity amongst them.

The previous frameworks follow the traditional data flow structure, which uses the DOM (Document Object Model).

DOM is an object which is created by the browser each time a web page is loaded.

It dynamically adds or removes the data at the back end and when any modifications were done, then each time a new DOM is created for the same page.

This repeated creation of DOM makes unnecessary memory wastage and reduces the performance of the application.

Therefore, a new technology ReactJS framework invented which remove this drawback.

ReactJS allows you to divide your entire application into various components.

ReactJS still used the same traditional data flow, but it is not directly operating on the browser’s Document Object Model (DOM) immediately; instead, it operates on a virtual DOM.

It means rather than manipulating the document in a browser after changes to our data, it resolves changes on a DOM built and run entirely in memory.

After the virtual DOM has been updated, React determines what changes made to the actual browser’s DOM.

The React Virtual DOM exists entirely in memory and is a representation of the web browser’s DOM.

Due to this, when we write a React component, we did not write directly to the DOM; instead, we are writing virtual components that react will turn into the DOM.

Leave a Reply

Your email address will not be published. Required fields are marked *


Enjoy this blog? Please spread the word :)

Follow by Email