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 Sep 10, 2024
1 parent 92e494a commit d4b767e
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 d4b767e

Please sign in to comment.