Skip to content

Commit

Permalink
Switch to ReactDOM.createRoot
Browse files Browse the repository at this point in the history
The old `ReactDOM.render` function is deprecated in React 18.

See: https://reactjs.org/link/switch-to-createroot
  • Loading branch information
ntninja committed Jul 23, 2024
1 parent 570cd63 commit 5be2888
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -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(
<StrictMode>
<ChakraProvider>
<App />
</ChakraProvider>
</StrictMode>,
document.getElementById("root")
</StrictMode>
);

0 comments on commit 5be2888

Please sign in to comment.