react-chartjs-2 icon indicating copy to clipboard operation
react-chartjs-2 copied to clipboard

Shallow props comparison in shouldComponentUpdate() makes charts redraw too frequently

Open leifkb opened this issue 10 years ago • 1 comments

The intention of the code seems to be that it will only redraw when the props are actually different, but in practice, it redraws as long as the props are a different object (i.e. basically always).

leifkb avatar Jun 05 '16 01:06 leifkb

Hey @leifkb,

Apologies for late reply. You are correct, we should either do deep comparison (somewhat performance ineffective) or we can return false for shouldComponentUpdate and if "redraw" is true in componentWillReceiveProps force an update?

Any thoughts are welcome.

Thanks for your time.

gor181 avatar Jun 15 '16 21:06 gor181