diff --git a/packages/react/src/__tests__/ReactJSXTransformIntegration-test.js b/packages/react/src/__tests__/ReactJSXTransformIntegration-test.js
index 6f764db3b11ce..9485db97be4ea 100644
--- a/packages/react/src/__tests__/ReactJSXTransformIntegration-test.js
+++ b/packages/react/src/__tests__/ReactJSXTransformIntegration-test.js
@@ -11,7 +11,6 @@
let React;
let ReactDOMClient;
-let ReactTestUtils;
let act;
// TODO: Historically this module was used to confirm that the JSX transform
@@ -30,7 +29,6 @@ describe('ReactJSXTransformIntegration', () => {
React = require('react');
ReactDOMClient = require('react-dom/client');
- ReactTestUtils = require('react-dom/test-utils');
act = require('internal-test-utils').act;
Component = class extends React.Component {
@@ -213,7 +211,7 @@ describe('ReactJSXTransformIntegration', () => {
expect(instance.props.fruit).toBe('persimmon');
});
- it('should normalize props with default values', () => {
+ it('should normalize props with default values', async () => {
class NormalizingComponent extends React.Component {
render() {
return {this.props.prop};
@@ -221,14 +219,26 @@ describe('ReactJSXTransformIntegration', () => {
}
NormalizingComponent.defaultProps = {prop: 'testKey'};
- const instance = ReactTestUtils.renderIntoDocument(
- ,
- );
+ let container = document.createElement('div');
+ let root = ReactDOMClient.createRoot(container);
+ let instance;
+ await act(() => {
+ root.render(
+ (instance = current)} />,
+ );
+ });
+
expect(instance.props.prop).toBe('testKey');
- const inst2 = ReactTestUtils.renderIntoDocument(
- ,
- );
+ container = document.createElement('div');
+ root = ReactDOMClient.createRoot(container);
+ let inst2;
+ await act(() => {
+ root.render(
+ (inst2 = current)} />,
+ );
+ });
+
expect(inst2.props.prop).toBe(null);
});
});