From daa5227f0724ea3de6e8db5d1c857bb3c390d3b9 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 7 Oct 2022 14:31:19 -0700 Subject: [PATCH] Fix the react app initialization. ReactDOM.render is deprecated and using it forces react 17 behavior. --- client/src/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/index.tsx b/client/src/index.tsx index 19e61f3d..f6d829dd 100644 --- a/client/src/index.tsx +++ b/client/src/index.tsx @@ -4,18 +4,20 @@ import { SocketProvider } from "./components/socketprovider/socketprovider"; import "./index.css"; import * as serviceWorker from "./serviceWorker"; import React from "react"; -import ReactDOM from "react-dom"; +import ReactDOM from "react-dom/client"; import { Provider } from "react-redux"; -ReactDOM.render( +const root = ReactDOM.createRoot( + document.getElementById("root") as HTMLElement +); +root.render( - , - document.getElementById("root") + ); // If you want your app to work offline and load faster, you can change