Closed ThenTech closed 1 year ago
can you reproduce the same problem with other chart.js chart types or just with this plugin?
I also experienced the same error Cannot read properties of null (reading 'addEventListener')
with my own chart.js wrapper.
Here's the code that reproduce the problem: https://codesandbox.io/p/sandbox/jolly-dew-vx64kl?file=%2Fapp%2Fpage.tsx%3A1%2C1
should be fixed with the latest patch release.
The problem was that the async chart update after the layout process was done didn't check whether the chart was destroyed or not
That was it exactly. I can confirm that error is not thrown any more in the v4.2.6
As mentioned here, I get the same error
Cannot read properties of null (reading 'addEventListener')
when using this plugin withreact-chartjs-2
. When rendering atree
type graph, at some point thechart.canvas
reference becomesnull
thus throwing the error increateProxyAndListen
fromChartJS
.If I add
redraw={true}
to thereact-chartjs-2
Chart
wrapper, and force it to recreate the graph every time, it does seem to work, but still throws the error 2 times.I am not sure if I'm missing something else or where exactly the problem originates.
To Reproduce
Use
react-chartjs-2
's Chart and create atree
type chart.Expected behavior
I expect the tree to be rendered the first time around.
Context