Re:Why-did-you-update – Warnings about unnecessary React upd...
by acemarke on Wednesday April 19, 2017 @02:57PM
(#14150675)
Good explanation, with one nitpick: the diff is done between the _old_ virtual DOM tree and the _new_ virtual DOM tree, not between the virtual DOM tree and the real DOM. That's why you can have a component that renders a single div, and then get the reference to the real DOM node and use jQuery or some other DOM-manipulating library to attach non-React-based DOM elements to the div. As far as React knows, you're just telling it to keep rendering that same div, so nothing needs to change.
[ Parent
| on HN ]