88// Needed for redux-saga es6 generator support
99// Import all the third party stuff
1010import React from 'react' ;
11- import ReactDOM from 'react-dom' ;
11+ import { createRoot } from 'react-dom/client ' ;
1212import { Router } from 'react-router-dom' ;
1313import { Provider } from 'react-redux' ;
1414import { PersistGate } from 'redux-persist/integration/react' ;
@@ -37,9 +37,9 @@ import { translationMessages } from './i18n';
3737const initialState = { } ;
3838const { store, persistor } = configureStore ( initialState , history ) ;
3939const MOUNT_NODE = document . getElementById ( 'app' ) ;
40-
40+ const root = createRoot ( MOUNT_NODE ) ;
4141const render = ( messages ) => {
42- ReactDOM . render (
42+ root . render (
4343 < ErrorBoundary >
4444 < Provider store = { store } >
4545 < PersistGate loading = { null } persistor = { persistor } >
@@ -52,8 +52,7 @@ const render = (messages) => {
5252 </ LanguageProvider >
5353 </ PersistGate >
5454 </ Provider >
55- </ ErrorBoundary > ,
56- MOUNT_NODE
55+ </ ErrorBoundary >
5756 ) ;
5857} ;
5958
@@ -62,7 +61,8 @@ if (module.hot) {
6261 // modules.hot.accept does not accept dynamic dependencies,
6362 // have to be constants at compile-time
6463 module . hot . accept ( [ './i18n' , 'containers/App' ] , ( ) => {
65- ReactDOM . unmountComponentAtNode ( MOUNT_NODE ) ;
64+ // ReactDOM.unmountComponentAtNode(MOUNT_NODE);
65+ root . unmount ( ) ;
6666 render ( translationMessages ) ;
6767 } ) ;
6868}
0 commit comments