docs: migrate the example to React 18 (#5533)
This commit is contained in:
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,
|
|
||||||
);
|
);
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
<body>
|
<body>
|
||||||
<noscript> You need to enable JavaScript to run this app. </noscript>
|
<noscript> You need to enable JavaScript to run this app. </noscript>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<script src="https://unpkg.com/react@17.0.2/umd/react.development.js"></script>
|
<script src="https://unpkg.com/react@18.2.0/umd/react.development.js"></script>
|
||||||
<script src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js"></script>
|
<script src="https://unpkg.com/react-dom@18.2.0/umd/react-dom.development.js"></script>
|
||||||
|
|
||||||
<!-- This is so that we use the bundled excalidraw.development.js file instead
|
<!-- This is so that we use the bundled excalidraw.development.js file instead
|
||||||
of the actual source code -->
|
of the actual source code -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user