Files
react/packages/react-devtools-shell/src/e2e-regression/app.js
T
Jan Kassens 0b4f443020 [flow] enable enforce_local_inference_annotations (#25921)
This setting is an incremental path to the next Flow version enforcing
type annotations on most functions (except some inline callbacks).

Used
```
node_modules/.bin/flow codemod annotate-functions-and-classes --write .
```
to add a majority of the types with some hand cleanup when for large
inferred objects that should just be `Fiber` or weird constructs
including `any`.

Suppressed the remaining issues.

Builds on #25918
2023-01-09 15:46:48 -05:00

32 lines
859 B
JavaScript

/** @flow */
// This test harness mounts each test app as a separate root to test multi-root applications.
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import {createRoot} from 'react-dom/client';
import ListApp from '../e2e-apps/ListApp';
function mountApp(App: () => React$Node) {
const container = document.createElement('div');
((document.body: any): HTMLBodyElement).appendChild(container);
const root = createRoot(container);
root.render(<App />);
}
function mountTestApp() {
mountApp(ListApp);
}
mountTestApp();
// ReactDOM Test Selector APIs used by Playwright e2e tests
// If they don't exist, we mock them
window.parent.REACT_DOM_APP = {
createTestNameSelector: name => `[data-testname="${name}"]`,
findAllNodes: (container, nodes) =>
container.querySelectorAll(nodes.join(' ')),
...ReactDOM,
};