Skip to content

Commit 88735ba

Browse files
authored
Update index.js
According to this link : https://reactjs.org/link/switch-to-createroot "ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it’s running React 17"
1 parent 4ca8dfc commit 88735ba

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import 'react-app-polyfill/stable'
22
import 'core-js'
33
import React from 'react'
4-
import ReactDOM from 'react-dom'
4+
import { createRoot } from 'react-dom/client'
55
import App from './App'
66
import reportWebVitals from './reportWebVitals'
77
import { Provider } from 'react-redux'
88
import store from './store'
99

10-
ReactDOM.render(
10+
createRoot(document.getElementById('root')).render(
1111
<Provider store={store}>
1212
<App />
1313
</Provider>,
14-
document.getElementById('root'),
1514
)
1615

1716
// If you want to start measuring performance in your app, pass a function

0 commit comments

Comments
 (0)