diff --git a/packages/react-devtools-shared/src/__tests__/componentStacks-test.js b/packages/react-devtools-shared/src/__tests__/componentStacks-test.js
index 401af1d9c5546..3f3ce3774332e 100644
--- a/packages/react-devtools-shared/src/__tests__/componentStacks-test.js
+++ b/packages/react-devtools-shared/src/__tests__/componentStacks-test.js
@@ -7,12 +7,11 @@
* @flow
*/
-import {normalizeCodeLocInfo} from './utils';
+import {getVersionedRenderImplementation, normalizeCodeLocInfo} from './utils';
describe('component stack', () => {
let React;
let act;
- let legacyRender;
let mockError;
let mockWarn;
@@ -30,11 +29,12 @@ describe('component stack', () => {
const utils = require('./utils');
act = utils.act;
- legacyRender = utils.legacyRender;
React = require('react');
});
+ const {render} = getVersionedRenderImplementation();
+
// @reactVersion >=16.9
it('should log the current component stack along with an error or warning', () => {
const Grandparent = () => ;
@@ -45,9 +45,7 @@ describe('component stack', () => {
return null;
};
- const container = document.createElement('div');
-
- act(() => legacyRender(, container));
+ act(() => render());
expect(mockError).toHaveBeenCalledWith(
'Test error.',
@@ -79,8 +77,7 @@ describe('component stack', () => {
return null;
};
- const container = document.createElement('div');
- act(() => legacyRender(, container));
+ act(() => render());
expect(useEffectCount).toBe(1);