InterviewSolution
Saved Bookmarks
| 1. |
Explain Virtual DOM in React? |
|
Answer» Sites built with VANILLA JavaScript directly updates the Real DOM. It is fine for smaller websites, but as your website grows complex, it slows down the website. This happens because the browser engine has to traverse all nodes even if you update only one node. Even Angular updates or work on Real DOM. ReactJS doesn’t update the Real DOM directly but has a concept of Virtual DOM. This causes a great performance benefit for ReactJS and so it’s faster than vanilla JavaScript apps and also Angular apps.
After that, it updates the Real DOM, whenever it’s best to update it. |
|