Skip to content

Commit 911b008

Browse files
authored
Upgrade demo to React 18 (#182)
1 parent 742355c commit 911b008

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

example/app.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Fragment, useState, useCallback, useMemo } from "react";
2-
import { render } from "react-dom";
2+
import { createRoot } from "react-dom/client";
33
import { ReactP5Wrapper } from "../src/index.tsx";
44
import * as box from "./sketches/box";
55
import * as torus from "./sketches/torus";
@@ -70,4 +70,6 @@ function App() {
7070
);
7171
}
7272

73-
render(<App />, document.getElementById("app"));
73+
const container = document.getElementById("app");
74+
const root = createRoot(container);
75+
root.render(<App />);

0 commit comments

Comments
 (0)