[Chartjs]-React setState() not updating state when button clicked

0👍

I wish I could use this as a comment, but I am recreating exactly what you have and cannot replicate your error. Your code is hard to interpret and that might be throwing me/us off. This is my implementation of your handleUpdate

const chartData = this.updated ? chart2 : chart1
this.setState({chartData}, () => {
  this.updated = this.updated ? false : true
})

Leave a comment