Skip to content

Commit fea2bcf

Browse files
committed
fix: add initial value to useRef
1 parent abfd2ca commit fea2bcf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/chart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function ChartComponent<
3333
...canvasProps
3434
} = props as ChartProps;
3535
const canvasRef = useRef<HTMLCanvasElement>(null);
36-
const chartRef = useRef<ChartJS | null>();
36+
const chartRef = useRef<ChartJS | null>(null);
3737

3838
const renderChart = () => {
3939
if (!canvasRef.current) return;

0 commit comments

Comments
 (0)