Update root call

This commit is contained in:
Pierre HUBERT 2022-08-04 17:24:53 +02:00
parent 6e992735a3
commit 51c23a93fe

View File

@ -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(
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(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
</React.StrictMode>
);
}
init();
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))