Chore: More backwards compatible changes needed for react 19 (#115422)

backwards compatible changes needed for react 19
This commit is contained in:
Ashley Harrison
2025-12-17 09:21:39 +00:00
committed by GitHub
parent aa3b9dc4da
commit fc4c699d85
12 changed files with 52 additions and 49 deletions
@@ -1,5 +1,5 @@
import { fireEvent, render, screen } from '@testing-library/react';
import * as React from 'react';
import { type ComponentProps, useRef } from 'react';
import { createDataFrame } from '@grafana/data';
@@ -16,14 +16,14 @@ jest.mock('react-use', () => {
return {
...reactUse,
useMeasure: () => {
const ref = React.useRef();
const ref = useRef(null);
return [ref, { width: 1600 }];
},
};
});
describe('FlameGraph', () => {
function setup(props?: Partial<React.ComponentProps<typeof FlameGraph>>) {
function setup(props?: Partial<ComponentProps<typeof FlameGraph>>) {
const flameGraphData = createDataFrame(data);
const container = new FlameGraphDataContainer(flameGraphData, { collapsing: true });
@@ -21,7 +21,7 @@ jest.mock('@grafana/assistant', () => ({
jest.mock('react-use', () => ({
...jest.requireActual('react-use'),
useMeasure: () => {
const ref = useRef();
const ref = useRef(null);
return [ref, { width: 1600 }];
},
}));