Skip to content Skip to sidebar Skip to footer

React-chartjs State Update Error

I made a React.JS component, which draws charts using react-chartjs wrapper around the chart.js library. I am getting an error on update, as if my data was corrupted. I am thinking

Solution 1:

If data passed into the component changes, points will animate between values using chart.js' .update(). If you want the chart destroyed and redrawn on every change, pass in redraw as a prop. For example <LineChart data={this.state.chartData} redraw />

Adding redraw solves the problem.


Post a Comment for "React-chartjs State Update Error"