ReactDOM is being unsupported in react 18

createRoot is now used
This commit is contained in:
Camerin Figueroa 2022-06-09 21:28:32 -04:00
parent 15328bb4a1
commit f891010db4
1 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import { createRoot } from 'react-dom/client';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import { createStore, applyMiddleware, compose } from 'redux'; import { createStore, applyMiddleware, compose } from 'redux';
import reduxThunk from 'redux-thunk'; import reduxThunk from 'redux-thunk';
@ -9,10 +9,10 @@ import reducers from './reducers';
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(reducers, composeEnhancers(applyMiddleware(reduxThunk))); const store = createStore(reducers, composeEnhancers(applyMiddleware(reduxThunk)));
const container = document.getElementById('root');
ReactDOM.render( createRoot(container).render(
<Provider store={store}> <Provider store={store}>
<App/> <App/>
</Provider>, </Provider>
document.querySelector('#root')
); );