kirjs / react-highcharts

React wrapper for Highcharts library
http://kirjs.github.io/react-highcharts/
MIT License
1.26k stars 233 forks source link

fixed bug with trying to destroy undefined #404

Open wewegamapas opened 6 years ago

wewegamapas commented 6 years ago

I have been dealing with this bug for a while now where navigating away from the page that contained HighChart components would causes errors of failing to destroy undefined object during componentWillUnmount.

After doing some research and looking around at similar projects using this library, I noticed that other people had similar issues where the library would try to destroy an already undefined object.

A common fix seemed to be checking to see if the chart existed before attempting to destroy it. This solved all the issues that I had with my application related to this error.