5๐
โ
Iโm not terribly familiar with ChartJS, but when I changed your existing code from const chartRef = useRef<Line>(null);
to const chartRef = useRef<'line'>(null);
(per the docs), the linter gave me a better idea as to the what needed to be fixed (on the ref
).
In your case:
export function App() {
const chartRef = useRef<ChartJS<"line", number[], string>>(null);
return (
<div className="App">
<h1>This is a chart.</h1>
<Line data={data} ref={chartRef} />
</div>
);
}
Source:stackexchange.com