docs: migrate the example to React 18 (#5533)
parent
08ce7c7fc3
commit
0a5da0269f
@ -1,12 +1,13 @@
|
|||||||
import React from "react";
|
import { StrictMode } from "react";
|
||||||
import ReactDOM from "react-dom";
|
import { createRoot } from "react-dom/client";
|
||||||
|
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
|
|
||||||
const rootElement = document.getElementById("root");
|
const rootElement = document.getElementById("root")!;
|
||||||
ReactDOM.render(
|
const root = createRoot(rootElement);
|
||||||
<React.StrictMode>
|
|
||||||
|
root.render(
|
||||||
|
<StrictMode>
|
||||||
<App />
|
<App />
|
||||||
</React.StrictMode>,
|
</StrictMode>,
|
||||||
rootElement,
|
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue