From 0a5da0269f707fe3a85dd533a61eae073d8be602 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Thu, 4 Aug 2022 12:24:13 +0530 Subject: [PATCH] docs: migrate the example to React 18 (#5533) --- src/packages/excalidraw/example/index.tsx | 15 ++++++++------- src/packages/excalidraw/example/public/index.html | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/packages/excalidraw/example/index.tsx b/src/packages/excalidraw/example/index.tsx index 902838ac..825a1016 100644 --- a/src/packages/excalidraw/example/index.tsx +++ b/src/packages/excalidraw/example/index.tsx @@ -1,12 +1,13 @@ -import React from "react"; -import ReactDOM from "react-dom"; +import { StrictMode } from "react"; +import { createRoot } from "react-dom/client"; import App from "./App"; -const rootElement = document.getElementById("root"); -ReactDOM.render( - +const rootElement = document.getElementById("root")!; +const root = createRoot(rootElement); + +root.render( + - , - rootElement, + , ); diff --git a/src/packages/excalidraw/example/public/index.html b/src/packages/excalidraw/example/public/index.html index 5256209e..7f4ed249 100644 --- a/src/packages/excalidraw/example/public/index.html +++ b/src/packages/excalidraw/example/public/index.html @@ -17,8 +17,8 @@
- - + +