Skip to content

Commit 1e9a964

Browse files
committed
Update devtools
I'm not sure if this is actually right. Relying on CI.
1 parent ecedff2 commit 1e9a964

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

packages/react-devtools-inline/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const contentWindow = iframe.contentWindow;
6060
const DevTools = initialize(contentWindow);
6161
```
6262

63-
<sup>3</sup> Because the DevTools interface makes use of several new React APIs (e.g. suspense, concurrent mode) it should be rendered using either `ReactDOM.createRoot` or `ReactDOM.createSyncRoot`. **It should not be rendered with `ReactDOM.render`.**
63+
<sup>3</sup> Because the DevTools interface makes use of several new React APIs (e.g. suspense, concurrent mode) it should be rendered using `ReactDOMClient.createRoot`. **It should not be rendered with `ReactDOM.render`.**
6464

6565
## Examples
6666

@@ -110,8 +110,7 @@ const DevTools = initializeFrontend(contentWindow);
110110
// as setting the src of the <iframe> would load a new page (without the injected backend).
111111

112112
// <DevTools /> interface can be rendered in the parent window at any time now...
113-
// Be sure to use either ReactDOM.createRoot()
114-
// or ReactDOM.createSyncRoot() to render this component.
113+
// Be sure to use ReactDOMClient.createRoot() to render this component.
115114

116115
// Let the backend know the frontend is ready and listening.
117116
activateBackend(contentWindow);
@@ -154,8 +153,7 @@ const { contentWindow } = iframe;
154153

155154
// Initialize DevTools UI to listen to the iframe.
156155
// This returns a React component we can render anywhere in the main window.
157-
// Be sure to use either ReactDOM.createRoot()
158-
// or ReactDOM.createSyncRoot() to render this component.
156+
// Be sure to use ReactDOMClient.createRoot() to render this component.
159157
const DevTools = initialize(contentWindow);
160158

161159
// Let the backend know to initialize itself.

packages/react-devtools-shell/src/app/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import {createElement} from 'react';
66
import {
77
// $FlowFixMe Flow does not yet know about createRoot()
88
createRoot,
9-
render,
10-
unmountComponentAtNode,
11-
} from 'react-dom';
9+
} from 'react-dom/client';
10+
import {render, unmountComponentAtNode} from 'react-dom';
1211
import DeeplyNestedComponents from './DeeplyNestedComponents';
1312
import Iframe from './Iframe';
1413
import EditableProps from './EditableProps';

packages/react-devtools-shell/src/e2e/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import * as React from 'react';
66
import * as ReactDOM from 'react-dom';
7+
import * as ReactDOMClient from 'react-dom/client';
78

89
const container = document.createElement('div');
910

@@ -14,7 +15,7 @@ const container = document.createElement('div');
1415
const App = require('./apps/ListApp').default;
1516

1617
// $FlowFixMe Flow doesn't know about createRoot() yet.
17-
const root = ReactDOM.createRoot(container);
18+
const root = ReactDOMClient.createRoot(container);
1819
root.render(<App />);
1920

2021
// ReactDOM Test Selector APIs used by Playwright e2e tests

packages/react-devtools-shell/src/e2e/devtools.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from 'react';
22
import * as ReactDOM from 'react-dom';
3+
import * as ReactDOMClient from 'react-dom/client';
34
import {
45
activate as activateBackend,
56
initialize as initializeBackend,
@@ -33,7 +34,7 @@ function init(appIframe, devtoolsContainer, appSource) {
3334

3435
inject(contentDocument, appSource, () => {
3536
// $FlowFixMe Flow doesn't know about createRoot() yet.
36-
ReactDOM.createRoot(devtoolsContainer).render(
37+
ReactDOMClient.createRoot(devtoolsContainer).render(
3738
<DevTools
3839
hookNamesModuleLoaderFunction={hookNamesModuleLoaderFunction}
3940
showTabBar={true}

0 commit comments

Comments
 (0)