From 88735ba58502483493a38e92fd59d53640f3a9f5 Mon Sep 17 00:00:00 2001 From: Arash zandi Date: Sun, 14 Aug 2022 08:27:07 +0430 Subject: [PATCH] Update index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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" --- src/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 0ffee3bdb..d19a3bcd3 100644 --- a/src/index.js +++ b/src/index.js @@ -1,17 +1,16 @@ import 'react-app-polyfill/stable' import 'core-js' import React from 'react' -import ReactDOM from 'react-dom' +import { createRoot } from 'react-dom/client' import App from './App' import reportWebVitals from './reportWebVitals' import { Provider } from 'react-redux' import store from './store' -ReactDOM.render( +createRoot(document.getElementById('root')).render( , - document.getElementById('root'), ) // If you want to start measuring performance in your app, pass a function