react icon indicating copy to clipboard operation
react copied to clipboard

Removing object from array inside the state of component not refresh all DOM

Open k-makarov opened this issue 11 years ago • 1 comments

I suppose that may be not a bug but my fault in code, when I filter an array in the state of component. Here is the question and description of my problem on SO: http://stackoverflow.com/questions/28021573/removing-object-from-array-inside-the-state-of-react-js-component-not-refresh-al and plnkr: http://plnkr.co/edit/5zLSClQYCGj3OcbYjVWh?p=preview

k-makarov avatar Jan 20 '15 13:01 k-makarov

This is by design. React does not poll state, only setState(...), forceUpdate() and React.render triggers re-renders..

You really should not bypass setState and mutate state directly. But if you are, then you'll need to forceUpdate or make dummy call to setState, but I don't really recommend either of those... but they do work.

syranide avatar Jan 21 '15 22:01 syranide