5 ms·
I call forceUpdate to trigger redraws when view state is managed outside of props. Feels like an imperative redraw to me. https://facebook.github.io/react/docs
by duncanawoods 11y ago
I call forceUpdate to trigger redraws when view state is managed outside of props. Feels like an imperative redraw to me.
https://facebook.github.io/react/docs/component-api.html#forceupdate https://facebook.github.io/react/docs/component-api.html#for...
- aljones 11y agoWell, yeah. That isn't the recommended way to use react.
- duncanawoods 11y agoIts pretty essential for non-trivial applications with data-structures more complex than can be handed over to React. setState is just sugar - it also calls forceUpdate.