Can i use destroy charts in React.js using Chart.js?

๐Ÿ‘:-1

Ok, so the component receive type prop? You can call it in the useEffect with deps array of this type prop. That is exactly what is the useEffect for. When type changes, you create side effect. (destroy and reinit chart)

https://chartjs.org/docs/latest/developers/api.html#destroy

Leave a comment