Skip to content

Commit

Permalink
Convert ReactUpdaters to createRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Silbermann committed Feb 14, 2024
1 parent adadb81 commit 16ee439
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,11 @@ describe('updaters', () => {
}
};

const root = ReactDOMClient.createRoot(document.createElement('div'));
await act(() => {
ReactDOM.render(<Parent />, document.createElement('div'));
assertLog(['onCommitRoot']);
root.render(<Parent />);
});
assertLog(['onCommitRoot']);
expect(setShouldSuspend).not.toBeNull();
expect(allSchedulerTypes).toEqual([[null]]);

Expand All @@ -315,7 +316,7 @@ describe('updaters', () => {
return promise;
});
assertLog(['onCommitRoot']);
expect(allSchedulerTypes).toEqual([[null], [Suspender], [Suspender]]);
expect(allSchedulerTypes).toEqual([[null], [Suspender], []]);

// Verify no outstanding flushes
await waitForAll([]);
Expand Down

0 comments on commit 16ee439

Please sign in to comment.