React·100 questions

What is virtual DOM and why is it not 'magic'?

Answer
Virtual DOM is an object representation of UI.
React compares trees and applies patches.
The gain is not in speed, but in the convenience of declarative UI.
The real cost is rendering and comparison.
Proper state management is more important.
Was this answer helpful?

More questions in this topic

Related questions from other topics