Skip to main content

Why Web Developers interested in React Js?

The amount of JavaScript tools is steadily increasing, turning the selection of appropriate technology into a challenge. But why developers are most interested in React js among those libraries.

Nowadays all the web applications are in SPAs. It means the DOM trees are huge nowadays, in turn we need to modify the DOM tree incessantly and a lot. This is a real performance and development pain.

Consider a DOM made of thousands of divs. We have lots of methods that handle events - clicks, submits.

What can do by the library like jQuery?
jQuery will find every node interested on an event and update it if necessary

It has two problems: It’s hard to manage and it’s inefficient.

The solution to problem 1 is declarativeness. Instead of low-level techniques like traversing the DOM tree manually, you simple declare how a component should look like. But this doesn’t solve the performance issue. This is exactly where the Virtual DOM comes into action.

First of all - the Virtual DOM was not invented by React, but React uses it and provides it for free.

Virtual DOM makes React js as Web Developers choice for SPAs.

So, What's Virtual DOM? I'll explain in the next post.

Happy Programming!

Comments

Popular posts from this blog

Microservices vs. APIs

It still surprises me just how many times I come across misconceptions around Micro Services and APIs. Often hearing phrases like micro services are fine grained web services or API is themselves are equivalent to micro services. These all sort of show fundamental misconceptions under the covers. So, I've written this just to really break that out and explain about what the key differences are in those two concepts. What is an API? An API, fundamentally Application Programming Interface, that is an interface. It's a way of making requests into a component. So it's the route that you go in to make those requests. In modern use that typically means a REST API, that's a call made using HTTP protocol using JSON data as the payload. What are Micro Services? So let's ensure we also have a clear crisp definition on what a micro service architecture really is. Micro-Services architecture is about breaking down large silo applications into smalle...

What's Virtual DOM?

There’s no big difference between the regular DOM and the virtual DOM. It’s better to think of the virtual DOM as React’s local and simplified copy of the HTML DOM. It allows React to do its computations within this abstract world and skip the real DOM operations, often slow and browser-specific. Real DOM operations are really really expensive. The Virtual DOM is an abstraction of the HTML DOM. It is lightweight and detached from the browser-specific implementation details.  One thing you should remember that the DOM itself was already an abstraction. So, Virtual DOM is an abstraction of an abstraction. :)