summaryrefslogtreecommitdiff
path: root/examples/integrations-playground/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'examples/integrations-playground/src/components')
-rw-r--r--examples/integrations-playground/src/components/Link.jsx3
-rw-r--r--examples/integrations-playground/src/components/SolidCounter.jsx18
2 files changed, 21 insertions, 0 deletions
diff --git a/examples/integrations-playground/src/components/Link.jsx b/examples/integrations-playground/src/components/Link.jsx
index 2758df130..040d112c3 100644
--- a/examples/integrations-playground/src/components/Link.jsx
+++ b/examples/integrations-playground/src/components/Link.jsx
@@ -1,3 +1,6 @@
+/* jsxImportSource: react */
+import React from 'react';
+
export default function Link({ to, text }) {
return <a href={to}>{text}</a>;
}
diff --git a/examples/integrations-playground/src/components/SolidCounter.jsx b/examples/integrations-playground/src/components/SolidCounter.jsx
new file mode 100644
index 000000000..4453b881c
--- /dev/null
+++ b/examples/integrations-playground/src/components/SolidCounter.jsx
@@ -0,0 +1,18 @@
+import { createSignal } from 'solid-js';
+
+export default function Counter(props) {
+ const [count, setCount] = createSignal(0);
+ const add = () => setCount(count() + 1);
+ const subtract = () => setCount(count() - 1);
+
+ return (
+ <>
+ <div class="counter">
+ <button onClick={subtract}>-</button>
+ <pre>{count()}</pre>
+ <button onClick={add}>+</button>
+ </div>
+ <div class="counter-message">{props.children}</div>
+ </>
+ );
+}