From 51c23a93fe47795859990aea02701cd1c4aa61f5 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Thu, 4 Aug 2022 17:24:53 +0200 Subject: [PATCH] Update root call --- src/index.tsx | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index ef2edf8..c0a1fea 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,15 +1,21 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import './index.css'; -import App from './App'; -import reportWebVitals from './reportWebVitals'; +import React from "react"; +import { createRoot } from "react-dom/client"; -ReactDOM.render( - - - , - document.getElementById('root') -); +import App from "./App"; +import "./index.css"; +import reportWebVitals from "./reportWebVitals"; + +async function init() { + const container = document.getElementById("root"); + const root = createRoot(container!); + root.render( + + + + ); +} + +init(); // If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log))