GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Convert ResponderEventPlugin to createRoot (#28190) · react/react@6e1e92f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-native-renderer/src/__tests__
    • ResponderEventPlugin-test.internal.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-native-renderer/src/__tests__/ResponderEventPlugin-test.internal.js‎

Copy file name to clipboardExpand all lines: packages/react-native-renderer/src/__tests__/ResponderEventPlugin-test.internal.js
+9-3Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,11 +1377,12 @@ describe('ResponderEventPlugin', () => {
13771377
expect(ResponderEventPlugin._getResponder()).toBe(null);
13781378
});
13791379

1380-
it('should determine the first common ancestor correctly', () => {
1380+
it('should determine the first common ancestor correctly', async () => {
13811381
// This test was moved here from the ReactTreeTraversal test since only the
13821382
// ResponderEventPlugin uses `getLowestCommonAncestor`
13831383
const React = require('react');
1384-
const ReactTestUtils = require('react-dom/test-utils');
1384+
const ReactDOMClient = require('react-dom/client');
1385+
const act = require('internal-test-utils').act;
13851386
const getLowestCommonAncestor =
13861387
require('react-native-renderer/src/legacy-events/ResponderEventPlugin').getLowestCommonAncestor;
13871388
// This works by accident and will likely break in the future.
@@ -1422,7 +1423,12 @@ describe('ResponderEventPlugin', () => {
14221423
}
14231424
}
14241425

1425-
const parent = ReactTestUtils.renderIntoDocument(<ParentComponent />);
1426+
const container = document.createElement('div');
1427+
const root = ReactDOMClient.createRoot(container);
1428+
let parent;
1429+
await act(() => {
1430+
root.render(<ParentComponent ref={current => (parent = current)} />);
1431+
});
14261432

14271433
const ancestors = [
14281434
// Common ancestor with self is self.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.