How to access the Chart.js instance?
The Chart.js instance can be accessed by placing a ref to the element as:
functionApp(){
const chartRef =useRef(null);
useEffect(()=>{
const chart = chartRef.current;
if(chart){
console.log('ChartJS', chart);
}
},[]);
return<Chartref={chartRef}type='line'data={chartData}/>;
}