3 ms·
To show something new to the user, state must be calculated and pushed either to the DOM or blitted to a canvas.
by strokirk 4y ago
To show something new to the user, state must be calculated and pushed either to the DOM or blitted to a canvas.
- dahart 4y agoNot 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.