Open denl95 opened 8 years ago
While this isn't an issue with react-chartjs specifically, with Redux being popular it might be good to document the behavior and steps to avoid it. By default connect
does a shallow check of the properties returned by it's select function. Since you always return an empty object connect
assumes nothing has changed.
This should fix your problem:
export default connect(() => ({}), undefined, undefined, {pure: false})(BarChart);
See Redux's documentation for details on the pure flag.
Alternatively, I suspect disabling the animation will fix the problem:
const chartOptions = {
...,
animate: false
};
animate: false
does not work for me on v1.2.0. The correct key is animation: false
When I am trying to map state from store using
connect
fromreact-redux
like this:It is rendered like on image below. Also when I move mouse over some bar then It returns to normal like on image without
connect
.And when I remove
connect
: