aboutsummaryrefslogtreecommitdiff
path: root/demos/simple-react/src/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'demos/simple-react/src/index.tsx')
-rw-r--r--demos/simple-react/src/index.tsx23
1 files changed, 23 insertions, 0 deletions
diff --git a/demos/simple-react/src/index.tsx b/demos/simple-react/src/index.tsx
new file mode 100644
index 000000000..c0f0ec181
--- /dev/null
+++ b/demos/simple-react/src/index.tsx
@@ -0,0 +1,23 @@
+import ReactDOM from "react-dom";
+import { Button } from "./components/button";
+
+const Base = ({}) => {
+ return (
+ <main>
+ <h1>I am the page</h1>
+ <h3>Here is some text</h3>
+ <Button
+ label="Do not click."
+ onClick={() => alert("I told u not to click!")}
+ ></Button>
+ </main>
+ );
+};
+
+function startReact() {
+ ReactDOM.render(() => <Base />, document.querySelector("#reactroot"));
+}
+
+globalThis.addEventListener("DOMContentLoaded", () => {
+ startReact();
+});