Skip to main content

7.18 How React Update DOM

How React Update the DOM PDF

  1. render() is called
    to functional and class-based comps
    doesn't immediately update the "real" DOM

    1. shouldComponentUpdate() passed!
  2. Compares Virtual DOMs:

Old Virtual DOMRe-rendered Virtual DOM
<div></div><div>...</div>

Faster than "real" DOM

  1. Differences?
    Differences found => Update "real" DOM (not re-render) No Differences? => Don't touch the "real" DOM!