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!
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
Post a Comment