7.18 How React Update DOM
render()
is called
to functional and class-based comps
doesn't immediately update the "real" DOMshouldComponentUpdate()
passed!
Compares
Virtual DOMs
:
Old Virtual DOM | Re-rendered Virtual DOM |
---|---|
<div></div> | <div>...</div> |
Faster than "real" DOM
- Differences?
Differences found => Update "real" DOM (not re-render) No Differences? => Don't touch the "real" DOM!