Skip to content

Commit c59c688

Browse files
committed
Try using non-compat render function
1 parent 8fc2e97 commit c59c688

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/js/src/mount.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ReactPyDjangoClient } from "./client";
2-
import ReactDOM from "preact/compat";
2+
import { render } from "preact";
33
import { Layout } from "@reactpy/client/src/components";
44

55
export function mountComponent(
@@ -75,5 +75,9 @@ export function mountComponent(
7575
}
7676

7777
// Start rendering the component
78-
ReactDOM.render(<Layout client={client} />, client.mountElement);
78+
if (client.mountElement) {
79+
render(<Layout client={client} />, client.mountElement);
80+
} else {
81+
console.error("Mount element is not defined. Cannot render the component.");
82+
}
7983
}

0 commit comments

Comments
 (0)