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 — Move createRoot/hydrateRoot to react-dom/client (#23385) · react/react@1780659

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • fixtures
    • blocks/src
      • index.js
    • concurrent/time-slicing/src
      • index.js
    • ssr2/src
      • index.js
    • ssr
      • src
        • index.js
      • yarn.lock
  • packages
    • react-devtools-core
      • src
        • standalone.js
      • webpack.standalone.js
    • react-devtools-extensions
      • webpack.config.js
    • react-devtools-inline
      • README.md
      • webpack.config.js
    • react-devtools-shared/src/__tests__
      • TimelineProfiler-test.js
      • console-test.js
      • inspectedElement-test.js
      • preprocessData-test.js
      • profilingCache-test.js
      • profilingCommitTreeBuilder-test.js
      • profilingHostRoot-test.js
      • store-test.js
      • storeStressTestConcurrent-test.js
    • react-devtools-shell
      • src
        • app
          • index.js
        • e2e
          • app.js
          • devtools.js
      • webpack.config.js
    • react-dom
      • client.js
      • npm
        • client.js
      • package.json
      • src
        • __tests__
          • ReactDOMConsoleErrorReporting-test.js
          • ReactDOMFiberAsync-test.js
          • ReactDOMFizzServer-test.js
          • ReactDOMFizzShellHydration-test.js
          • ReactDOMHooks-test.js
          • ReactDOMImageLoad-test.internal.js
          • ReactDOMNativeEventHeuristic-test.js
          • ReactDOMNestedEvents-test.js
          • ReactDOMRoot-test.js
          • ReactDOMSafariMicrotaskBug-test.js
          • ReactDOMServerPartialHydration-test.internal.js
          • ReactDOMServerSelectiveHydration-test.internal.js
          • ReactDOMServerSuspense-test.internal.js
          • ReactDOMUseId-test.js
          • ReactServerRenderingHydration-test.js
          • ReactTestUtilsAct-test.js
          • ReactUpdates-test.js
        • client
          • ReactDOM.js
          • ReactDOMLegacy.js
          • ReactDOMRoot.js
        • events
          • __tests__
            • DOMPluginEventSystem-test.internal.js
          • plugins/__tests__
            • ChangeEventPlugin-test.js
            • SimpleEventPlugin-test.js
    • react-interactions/events/src/dom/create-event-handle/__tests__
      • useFocusWithin-test.internal.js
    • react-reconciler/src
      • ReactFiberBeginWork.new.js
      • ReactFiberBeginWork.old.js
      • ReactFiberDevToolsHook.new.js
      • ReactFiberDevToolsHook.old.js
      • __tests__
        • ReactScope-test.internal.js
        • ReactSuspenseEffectsSemanticsDOM-test.js
        • ReactUpdaters-test.internal.js
        • useMutableSourceHydration-test.js
    • react-refresh/src/__tests__
      • ReactFresh-test.js
    • react-server-dom-relay/src/__tests__
      • ReactFlightDOMRelay-test.internal.js
    • react-server-dom-webpack/src/__tests__
      • ReactFlightDOM-test.js
      • ReactFlightDOMBrowser-test.js
    • react/src/__tests__
      • ReactCoffeeScriptClass-test.coffee
      • ReactES6Class-test.js
      • ReactStrictMode-test.internal.js
      • ReactStrictMode-test.js
      • ReactTypeScriptClass-test.ts
      • testDefinitions
        • ReactDOM.d.ts
        • ReactDOMClient.d.ts
    • use-sync-external-store/src/__tests__
      • useSyncExternalStoreShared-test.js
  • scripts
    • jest/typescript
      • preprocessor.js
    • shared
      • inlinedHostConfigs.js

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎fixtures/blocks/src/index.js‎

Copy file name to clipboardExpand all lines: fixtures/blocks/src/index.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import React from 'react';
9-
import {createRoot} from 'react-dom';
9+
import {createRoot} from 'react-dom/client';
1010
import './index.css';
1111
import Router from './Router';
1212

Collapse file

‎fixtures/concurrent/time-slicing/src/index.js‎

Copy file name to clipboardExpand all lines: fixtures/concurrent/time-slicing/src/index.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, {PureComponent, unstable_startTransition} from 'react';
2-
import {createRoot} from 'react-dom';
2+
import {createRoot} from 'react-dom/client';
33
import _ from 'lodash';
44
import Charts from './Charts';
55
import Clock from './Clock';
Collapse file

‎fixtures/ssr/src/index.js‎

Copy file name to clipboardExpand all lines: fixtures/ssr/src/index.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import {hydrateRoot} from 'react-dom';
2+
import {hydrateRoot} from 'react-dom/client';
33

44
import App from './components/App';
55

Collapse file

‎fixtures/ssr/yarn.lock‎

Copy file name to clipboardExpand all lines: fixtures/ssr/yarn.lock
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4265,7 +4265,7 @@ longest@^1.0.1:
42654265
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
42664266
integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=
42674267

4268-
loose-envify@^1.0.0:
4268+
loose-envify@^1.0.0, loose-envify@^1.1.0:
42694269
version "1.4.0"
42704270
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
42714271
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -5945,6 +5945,14 @@ sax@^1.2.1, sax@~1.2.1:
59455945
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
59465946
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
59475947

5948+
scheduler@^0.20.1:
5949+
version "0.20.2"
5950+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
5951+
integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
5952+
dependencies:
5953+
loose-envify "^1.1.0"
5954+
object-assign "^4.1.1"
5955+
59485956
"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0:
59495957
version "5.7.1"
59505958
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
Collapse file

‎fixtures/ssr2/src/index.js‎

Copy file name to clipboardExpand all lines: fixtures/ssr2/src/index.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*/
88

9-
import {hydrateRoot} from 'react-dom';
9+
import {hydrateRoot} from 'react-dom/client';
1010
import App from './App';
1111

1212
hydrateRoot(document, <App assets={window.assetManifest} />);
Collapse file

‎packages/react-devtools-core/src/standalone.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-core/src/standalone.js
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ import {createElement} from 'react';
1111
import {
1212
// $FlowFixMe Flow does not yet know about flushSync()
1313
flushSync,
14-
// $FlowFixMe Flow does not yet know about createRoot()
15-
createRoot,
16-
} from 'react-dom';
14+
} from 'react-dom/client';
15+
import {createRoot} from 'react-dom/client';
1716
import Bridge from 'react-devtools-shared/src/bridge';
1817
import Store from 'react-devtools-shared/src/devtools/store';
1918
import {
Collapse file

‎packages/react-devtools-core/webpack.standalone.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-core/webpack.standalone.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ module.exports = {
6464
react: resolve(builtModulesDir, 'react'),
6565
'react-debug-tools': resolve(builtModulesDir, 'react-debug-tools'),
6666
'react-devtools-feature-flags': resolveFeatureFlags(featureFlagTarget),
67+
'react-dom/client': resolve(builtModulesDir, 'react-dom/client'),
6768
'react-dom': resolve(builtModulesDir, 'react-dom'),
6869
'react-is': resolve(builtModulesDir, 'react-is'),
6970
scheduler: resolve(builtModulesDir, 'scheduler'),
Collapse file

‎packages/react-devtools-extensions/webpack.config.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-extensions/webpack.config.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ module.exports = {
7676
react: resolve(builtModulesDir, 'react'),
7777
'react-debug-tools': resolve(builtModulesDir, 'react-debug-tools'),
7878
'react-devtools-feature-flags': resolveFeatureFlags(featureFlagTarget),
79+
'react-dom/client': resolve(builtModulesDir, 'react-dom/client'),
7980
'react-dom': resolve(builtModulesDir, 'react-dom'),
8081
'react-is': resolve(builtModulesDir, 'react-is'),
8182
scheduler: resolve(builtModulesDir, 'scheduler'),
Collapse file

‎packages/react-devtools-inline/README.md‎

Copy file name to clipboardExpand all lines: packages/react-devtools-inline/README.md
+3-5Lines changed: 3 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
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.
Collapse file

‎packages/react-devtools-inline/webpack.config.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-inline/webpack.config.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module.exports = {
5151
externals: {
5252
react: 'react',
5353
'react-dom': 'react-dom',
54+
'react-dom/client': 'react-dom/client',
5455
'react-is': 'react-is',
5556
scheduler: 'scheduler',
5657
},

0 commit comments

Comments
0 (0)
You are visitor 01402775 — 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.