File tree Expand file tree Collapse file tree 5 files changed +10
-10
lines changed
packages/scratch-gui/src/playground Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
2+ import ReactDomClient from 'react-dom/client ' ;
33import { connect } from 'react-redux' ;
44
55import Controls from '../containers/controls.jsx' ;
@@ -32,5 +32,5 @@ const App = AppStateHOC(HashParserHOC(BlocksOnly));
3232const appTarget = document . createElement ( 'div' ) ;
3333document . body . appendChild ( appTarget ) ;
3434
35- const root = ReactDOM . createRoot ( appTarget ) ;
35+ const root = ReactDomClient . createRoot ( appTarget ) ;
3636root . render ( < App /> ) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
2+ import ReactDomClient from 'react-dom/client ' ;
33
44import GUI from '../containers/gui.jsx' ;
55import HashParserHOC from '../lib/hash-parser-hoc.jsx' ;
@@ -53,5 +53,5 @@ class Player extends React.Component {
5353const appTarget = document . createElement ( 'div' ) ;
5454document . body . appendChild ( appTarget ) ;
5555
56- const root = ReactDOM . createRoot ( appTarget ) ;
56+ const root = ReactDomClient . createRoot ( appTarget ) ;
5757root . render ( < Player /> ) ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import 'core-js/fn/promise/finally';
55import 'intl' ; // For Safari 9
66
77import React from 'react' ;
8- import ReactDOM from 'react-dom' ;
8+ import ReactDomClient from 'react-dom/client ' ;
99
1010import AppStateHOC from '../lib/app-state-hoc.jsx' ;
1111import BrowserModalComponent from '../components/browser-modal/browser-modal.jsx' ;
@@ -26,7 +26,7 @@ if (supportedBrowser()) {
2626 BrowserModalComponent . setAppElement ( appTarget ) ;
2727 const WrappedBrowserModalComponent = AppStateHOC ( BrowserModalComponent , true /* localesOnly */ ) ;
2828 const handleBack = ( ) => { } ;
29- const root = ReactDOM . createRoot ( appTarget ) ;
29+ const root = ReactDomClient . createRoot ( appTarget ) ;
3030 // eslint-disable-next-line react/jsx-no-bind
3131 root . render ( < WrappedBrowserModalComponent onBack = { handleBack } /> ) ;
3232}
Original file line number Diff line number Diff line change 11import classNames from 'classnames' ;
22import PropTypes from 'prop-types' ;
33import React from 'react' ;
4- import ReactDOM from 'react-dom' ;
4+ import ReactDomClient from 'react-dom/client ' ;
55import { connect } from 'react-redux' ;
66import { compose } from 'redux' ;
77
@@ -61,5 +61,5 @@ const WrappedPlayer = compose(
6161const appTarget = document . createElement ( 'div' ) ;
6262document . body . appendChild ( appTarget ) ;
6363
64- const root = ReactDOM . createRoot ( appTarget ) ;
64+ const root = ReactDomClient . createRoot ( appTarget ) ;
6565root . render ( < WrappedPlayer isPlayerOnly /> ) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
2+ import ReactDomClient from 'react-dom/client ' ;
33import { compose } from 'redux' ;
44
55import AppStateHOC from '../lib/app-state-hoc.jsx' ;
@@ -62,7 +62,7 @@ export default appTarget => {
6262 window . onbeforeunload = ( ) => true ;
6363 }
6464
65- const root = ReactDOM . createRoot ( appTarget ) ;
65+ const root = ReactDomClient . createRoot ( appTarget ) ;
6666
6767 root . render (
6868 // important: this is checking whether `simulateScratchDesktop` is truthy, not just defined!
You can’t perform that action at this time.
0 commit comments