diff --git a/src/index.tsx b/src/index.tsx index cf5d507b..933bdfa5 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -7,7 +7,7 @@ import { configureStore } from '@reduxjs/toolkit'; import { I18nContext } from '@shopify/react-i18n'; import React from 'react'; import { OverlayProvider } from 'react-aria'; -import ReactDOM from 'react-dom'; +import { createRoot } from 'react-dom/client'; import { Provider } from 'react-redux'; import { createLogger } from 'redux-logger'; import createSagaMiddleware from 'redux-saga'; @@ -20,6 +20,7 @@ import { serializableCheck } from './redux'; import reportWebVitals from './reportWebVitals'; import rootSaga, { RootSagaContext } from './sagas'; import { defaultTerminalContext } from './terminal/TerminalContext'; +import { defined } from './utils'; import { createCountFunc } from './utils/iter'; const toasterRef = React.createRef(); @@ -72,20 +73,21 @@ window.addEventListener('drop', dragEventHandler); sagaMiddleware.run(rootSaga); -ReactDOM.render( - - - - - - - - - - - - , - document.getElementById('root'), +const container = document.getElementById('root'); +defined(container); +const root = createRoot(container); + +root.render( + + + + + + + + + + , ); // If you want to start measuring performance in your app, pass a function