MCPcopy Index your code
hub / github.com/reactchartjs/react-chartjs-2 / ref

Function ref

test/chart.test.tsx:18–25  ·  view source on GitHub ↗
(el: ChartJS<any> | undefined | null)

Source from the content-addressed store, hash-verified

16
17 let chart: any, update: any, destroy: any;
18 const ref = (el: ChartJS<any> | undefined | null): void => {
19 chart = el;
20
21 if (chart) {
22 update = vi.spyOn(chart, 'update');
23 destroy = vi.spyOn(chart, 'destroy');
24 }
25 };
26
27 beforeEach(() => {
28 chart = null;

Callers 1

reforwardRefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected