3 ms·
To be more specific, when ReactDOM.render() is called from a component -- is the argument that the entire screen does not have to be painted?
by jzer0cool 7y ago
To be more specific, when ReactDOM.render() is called from a component -- is the argument that the entire screen does not have to be painted?
- fgerschau 7y agoBy that I mean that there's a difference between calling React's render function and rendering something to the browser DOM (native renders). React will try to reduce the number of renders to the real DOM as much as possible, so calling a component's render functions doesn't always imply a re-paint of the UI. Expanding a text box wouldn't usually trigger a re-render because this is being handled by the browser and doesn't affect the state of the application (just like any CSS rules). Reordering elements on the other hand will trigger a re-render because the actual HTML element's position has to change. So yes, the argument is that the entire screen doesn't have to be repainted. In the ideal case it only repaints the parts of the UI that need to change.