We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fc2e97 commit c59c688Copy full SHA for c59c688
src/js/src/mount.tsx
@@ -1,5 +1,5 @@
1
import { ReactPyDjangoClient } from "./client";
2
-import ReactDOM from "preact/compat";
+import { render } from "preact";
3
import { Layout } from "@reactpy/client/src/components";
4
5
export function mountComponent(
@@ -75,5 +75,9 @@ export function mountComponent(
75
}
76
77
// Start rendering the component
78
- ReactDOM.render(<Layout client={client} />, client.mountElement);
+ 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
+ }
83
0 commit comments