React.js (Introduction and Working)

Recent articles on React.js!

Introduction to ReactJS?
Let we understand this with a practical example:
Lets say one of your friends posted a photograph on Facebook. Now you go and like the image and then you suddenly see that lets check out the comments too. Now while you are browsing over comments you see that likes count increased by count 100 since you liked the picture. Yes and there was no reload of the page, just somehow magically the count changed. Behind this magic its react.js.

React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It’s ‘V’ in MVC. ReactJS is an open-source, component based front end library responsible only for the view layer of the application. It is maintained by Facebook.

React uses a declarative paradigm that makes it easier to reason about your application and aims to be both efficient and flexible. It design simple views for each state in your application, and React will efficiently update and render just the right component when your data changes.Declarative view make your code more predictable and easier to debug.

A react application is made of multiple components, each responsible for rendering a small, reusable piece of HTML. Components can be nested within other components to allow complex applications to be built out of simple building blocks. A component may also maintain internal state – for example a TabList component may store a variable corresponding to the currently open tab.
NOTE: React is not a framework. It is just a library developed by Facebook to solve some problems that they were facing.

How does it works:
While building client-side apps, a team at Facebook developers realized that the DOM is slow (The Document Object Model (DOM) is an application programming interface (API) for HTML and XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated.). So, to make it faster, React implements a virtual DOM that is basically a DOM tree representation in Javascript. So when it needs to read or write to the DOM, it will use the virtual representation of it. Then the virtual DOM will try to find the most efficient way to update the browser’s DOM.

Unlike browser DOM elements, React elements are plain objects, and are cheap to create. React DOM takes care of updating the DOM to match the React elements. The rationale for this is that JavaScript is very fast and it’s worth keeping a DOM tree in it to speedup its manipulation.

Although React was conceived to be used in the browser, because of its design it can also be used in the server with Node.js.

References :

This article is contributed by Amit Khandelwal. If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

My Personal Notes arrow_drop_up

Article Tags :


Please write to us at to report any issue with the above content.