4 ms·
In answer to your first question, yes. See the documentation for `render`: https://facebook.github.io/react/docs/react-dom.html#render https://facebook.github.i
by mambodog 10y ago
In answer to your first question, yes. See the documentation for `render`: https://facebook.github.io/react/docs/react-dom.html#render https://facebook.github.io/react/docs/react-dom.html#render
In answer to your second question, yes, React currently only does anything as a consequence of calling `render`, or `.setState()`/`.forceUpdate()` in the case of a component class (not relevant if you're not using component classes).
In future, the (currently experimental) 'fiber' render will allow some rendering to be deferred until after the current call stack has finished (to avoid blocking the UI), but there should be away to tell React to do all rendering synchronously if you desire (which is necessary for eg. rendering on the server). There's no reason why the current behavior couldn't be supported on top of the new experimental renderer though.