From fa143ea029d453c2228e9f5f8c1438efb2b997c5 Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Mon, 4 Apr 2022 09:39:18 +1000 Subject: [PATCH] fix(web): update client rendering method (#3106) This PR utilises the React 18 Client Rendering API along with createRoot as opposed to the React 17 ReactDOM.render method. --- web/src/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/src/index.tsx b/web/src/index.tsx index ee2d6014f..942f0ab49 100644 --- a/web/src/index.tsx +++ b/web/src/index.tsx @@ -1,13 +1,14 @@ import React from "react"; -import ReactDOM from "react-dom"; +import { createRoot } from "react-dom/client"; import "@root/index.css"; import App from "@root/App"; import * as serviceWorker from "@root/serviceWorker"; -import "./i18n/index.ts"; +import "@i18n/index.ts"; -ReactDOM.render(, document.getElementById("root")); +const root = createRoot(document.getElementById("root")!); +root.render(); // If you want your app to work offline and load faster, you can change // unregister() to register() below. Note this comes with some pitfalls.