(props: Props)
| 41 | }; |
| 42 | |
| 43 | export function Chart(props: Props) { |
| 44 | const canvasRef = useRef<HTMLCanvasElement>(null); |
| 45 | let chartRef: ChartJS | undefined; |
| 46 | |
| 47 | useEffect(() => { |
| 48 | if (!canvasRef.current) return; |
| 49 | |
| 50 | chartRef = new ChartJS(canvasRef.current, props.config); |
| 51 | return () => chartRef?.destroy(); |
| 52 | }, [canvasRef, props.config]); |
| 53 | |
| 54 | return <canvas ref={canvasRef} />; |
| 55 | } |
nothing calls this directly
no outgoing calls
no test coverage detected