From 555b8a8a95ec0fee05c15dcf3d278c85bb103958 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com>
Date: Sat, 8 Oct 2022 17:55:11 +0100
Subject: [PATCH] feat: new format for react mount

---
 examples/web/react/app.tsx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/web/react/app.tsx b/examples/web/react/app.tsx
index ed6b8eac..27f27484 100644
--- a/examples/web/react/app.tsx
+++ b/examples/web/react/app.tsx
@@ -110,7 +110,12 @@ export const App = () => {
 };
 
 export const startApp = (element: string) => {
-    const root = ReactDOM.createRoot(document.getElementById(element)!);
+    const elementRef = document.getElementById(element);
+    if (!elementRef) {
+        return;
+    }
+
+    const root = ReactDOM.createRoot(elementRef);
     root.render(<App />);
 };
 
-- 
GitLab