From 44c993b7f582a7b81d4a6b5fd38ea5a815fa3d9d Mon Sep 17 00:00:00 2001 From: Jan Kassens Date: Fri, 19 Jan 2024 12:14:30 -0500 Subject: [PATCH] Convert ReactUpdaters-test.internal to createRoot --- .../src/__tests__/ReactUpdaters-test.internal.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/react-reconciler/src/__tests__/ReactUpdaters-test.internal.js b/packages/react-reconciler/src/__tests__/ReactUpdaters-test.internal.js index 93e1d6937764d..1727a595365ef 100644 --- a/packages/react-reconciler/src/__tests__/ReactUpdaters-test.internal.js +++ b/packages/react-reconciler/src/__tests__/ReactUpdaters-test.internal.js @@ -106,15 +106,15 @@ describe('updaters', () => { const Parent = () => ; const Child = () => null; - const container = document.createElement('div'); + const root = ReactDOMClient.createRoot(document.createElement('div')); await act(() => { - ReactDOM.render(, container); + root.render(); }); expect(allSchedulerTags).toEqual([[HostRoot]]); await act(() => { - ReactDOM.render(, container); + root.render(); }); expect(allSchedulerTags).toEqual([[HostRoot], [HostRoot]]); }); @@ -141,8 +141,9 @@ describe('updaters', () => { }; const Child = () => null; + const root = ReactDOMClient.createRoot(document.createElement('div')); await act(() => { - ReactDOM.render(, document.createElement('div')); + root.render(); }); expect(scheduleForA).not.toBeNull(); expect(scheduleForB).not.toBeNull(); @@ -174,8 +175,9 @@ describe('updaters', () => { } const Child = () => null; let instance; + const root = ReactDOMClient.createRoot(document.createElement('div')); await act(() => { - ReactDOM.render(, document.createElement('div')); + root.render(); }); expect(allSchedulerTypes).toEqual([[null]]);