summaryrefslogtreecommitdiff
path: root/examples/framework-preact/src/components/Counter.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'examples/framework-preact/src/components/Counter.tsx')
-rw-r--r--examples/framework-preact/src/components/Counter.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/framework-preact/src/components/Counter.tsx b/examples/framework-preact/src/components/Counter.tsx
index f7db88c6d..a63bf0cd7 100644
--- a/examples/framework-preact/src/components/Counter.tsx
+++ b/examples/framework-preact/src/components/Counter.tsx
@@ -1,11 +1,17 @@
-import { h, Fragment } from 'preact';
+import type { ComponentChildren } from 'preact';
+import type { Signal } from '@preact/signals';
import { lazy, Suspense } from 'preact/compat';
import './Counter.css';
const Message = lazy(async () => import('./Message'));
const Fallback = () => <p>Loading...</p>;
-export default function Counter({ children, count }) {
+type Props = {
+ children: ComponentChildren;
+ count: Signal<number>;
+};
+
+export default function Counter({ children, count }: Props) {
const add = () => count.value++;
const subtract = () => count.value--;