If you’re learning about React, it’s important you know the difference between the Virtual DOM and the Real DOM. Especially during your job search. It’s critical to know what they are and what they do. Keep reading!
What is the Virtual DOM?
I like to start off with a visual example of what the Virtual DOM is. So imagine you’re building your first house. Where do you start? Well, you’ll need to build and create a blueprint of your house. While you’re creating a blueprint, you decide you want 3 bedrooms and 2 bathrooms. Along the way, you’re not entirely satisfied with the blueprint. Rather than starting over or rebuilding your blueprint, you can edit it. This approach is more efficient and it saves time. Am I right?
The Virtual DOM does exactly that.
What is the Real DOM?