Skip to content

Commit d4b6358

Browse files
hoxyqAndyPengc12
authored andcommitted
chore: use versioned render in profilerChangeDescriptions test (facebook#28221)
1 parent 67f484a commit d4b6358

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

packages/react-devtools-shared/src/__tests__/profilerChangeDescriptions-test.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,26 @@
77
* @flow
88
*/
99

10+
import {getVersionedRenderImplementation} from './utils';
11+
1012
describe('Profiler change descriptions', () => {
1113
let React;
12-
let legacyRender;
1314
let store;
1415
let utils;
1516

1617
beforeEach(() => {
1718
utils = require('./utils');
1819
utils.beforeEachProfiling();
1920

20-
legacyRender = utils.legacyRender;
21-
2221
store = global.store;
2322
store.collapseNodesByDefault = false;
2423
store.recordChangeDescriptions = true;
2524

2625
React = require('react');
2726
});
2827

28+
const {render} = getVersionedRenderImplementation();
29+
2930
// @reactVersion >=18.0
3031
it('should identify useContext as the cause for a re-render', () => {
3132
const Context = React.createContext(0);
@@ -62,10 +63,8 @@ describe('Profiler change descriptions', () => {
6263
);
6364
};
6465

65-
const container = document.createElement('div');
66-
6766
utils.act(() => store.profilerStore.startProfiling());
68-
utils.act(() => legacyRender(<App />, container));
67+
utils.act(() => render(<App />));
6968
utils.act(() => forceUpdate());
7069
utils.act(() => store.profilerStore.stopProfiling());
7170

0 commit comments

Comments
 (0)