From 5be28882d0c840b0418a430af8ff78246f075446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erin=E2=80=84Yuki=E2=80=89Schlarb?= Date: Fri, 19 Jul 2024 15:50:02 +0200 Subject: [PATCH] Switch to `ReactDOM.createRoot` The old `ReactDOM.render` function is deprecated in React 18. See: https://reactjs.org/link/switch-to-createroot --- src/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index c233159..ca38d6b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,15 +1,15 @@ import { StrictMode } from "react"; -import ReactDOM from "react-dom"; +import { createRoot } from "react-dom/client"; import { ChakraProvider } from "@chakra-ui/react"; import * as wasm from "rustpad-wasm"; import App from "./App"; import "./index.css"; -ReactDOM.render( +const root = createRoot(document.getElementById("root")); +root.render( - , - document.getElementById("root") + );