score:-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


Related Query

More Query from same tag