3 ms·
Not sure I understand your point, can you elaborate? My point is that updating the state for a single element causes React to compute the state for the whole p
by dahart 4y ago
Not sure I understand your point, can you elaborate?
My point is that updating the state for a single element causes React to compute the state for the whole page, and diff the whole page virtual DOM against the whole page actual DOM, before pushing the update of that single element into the DOM. With pure JavaScript, you can skip all that and directly update a single element. This is often in practice much faster.