Opt-into react 18 concurrent renderer

This commit is contained in:
Willian Mitsuda 2022-08-06 23:40:59 -03:00
parent 8ad1c7186b
commit 6b9d8f6190
1 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import ReactDOM from "react-dom"; import { createRoot } from "react-dom/client";
import { HelmetProvider, Helmet } from "react-helmet-async"; import { HelmetProvider, Helmet } from "react-helmet-async";
import "@fontsource/space-grotesk/index.css"; import "@fontsource/space-grotesk/index.css";
import "@fontsource/roboto/index.css"; import "@fontsource/roboto/index.css";
@ -9,7 +9,9 @@ import "./index.css";
import App from "./App"; import App from "./App";
import reportWebVitals from "./reportWebVitals"; import reportWebVitals from "./reportWebVitals";
ReactDOM.render( const container = document.getElementById("root");
const root = createRoot(container!);
root.render(
<React.StrictMode> <React.StrictMode>
<HelmetProvider> <HelmetProvider>
<Helmet> <Helmet>
@ -23,8 +25,7 @@ ReactDOM.render(
</Helmet> </Helmet>
<App /> <App />
</HelmetProvider> </HelmetProvider>
</React.StrictMode>, </React.StrictMode>
document.getElementById("root")
); );
// If you want to start measuring performance in your app, pass a function // If you want to start measuring performance in your app, pass a function