summaryrefslogtreecommitdiff
path: root/examples/framework-multiple/src
diff options
context:
space:
mode:
authorGravatar Bjorn Lu <bjornlu.dev@gmail.com> 2024-03-13 17:35:33 +0800
committerGravatar GitHub <noreply@github.com> 2024-03-13 17:35:33 +0800
commit8dceb5eb36226f1d097d02c47e1b24231dc333d1 (patch)
tree22662b9b3bbb9555d7152b4239fac00d55b9d1b0 /examples/framework-multiple/src
parentf456fed23cfffd5b7d09d1b541f858a90f5ea20f (diff)
downloadastro-8dceb5eb36226f1d097d02c47e1b24231dc333d1.tar.gz
astro-8dceb5eb36226f1d097d02c47e1b24231dc333d1.tar.zst
astro-8dceb5eb36226f1d097d02c47e1b24231dc333d1.zip
Fix check example CI fail (#10415)
Diffstat (limited to 'examples/framework-multiple/src')
-rw-r--r--examples/framework-multiple/src/components/preact/PreactCounter.tsx3
-rw-r--r--examples/framework-multiple/src/components/react/ReactCounter.tsx6
-rw-r--r--examples/framework-multiple/src/components/solid/SolidCounter.tsx6
3 files changed, 9 insertions, 6 deletions
diff --git a/examples/framework-multiple/src/components/preact/PreactCounter.tsx b/examples/framework-multiple/src/components/preact/PreactCounter.tsx
index 2fb0a54b9..5ad164cc2 100644
--- a/examples/framework-multiple/src/components/preact/PreactCounter.tsx
+++ b/examples/framework-multiple/src/components/preact/PreactCounter.tsx
@@ -1,9 +1,10 @@
/** @jsxImportSource preact */
import { useState } from 'preact/hooks';
+import type { ComponentChildren } from 'preact';
/** A counter written with Preact */
-export function PreactCounter({ children }) {
+export function PreactCounter({ children }: { children?: ComponentChildren }) {
const [count, setCount] = useState(0);
const add = () => setCount((i) => i + 1);
const subtract = () => setCount((i) => i - 1);
diff --git a/examples/framework-multiple/src/components/react/ReactCounter.tsx b/examples/framework-multiple/src/components/react/ReactCounter.tsx
index 1cff97917..84681035d 100644
--- a/examples/framework-multiple/src/components/react/ReactCounter.tsx
+++ b/examples/framework-multiple/src/components/react/ReactCounter.tsx
@@ -1,7 +1,9 @@
-import { useState } from 'react';
+/** @jsxImportSource react */
+
+import { useState, type ReactNode } from 'react';
/** A counter written with React */
-export function Counter({ children }) {
+export function Counter({ children }: { children?: ReactNode }) {
const [count, setCount] = useState(0);
const add = () => setCount((i) => i + 1);
const subtract = () => setCount((i) => i - 1);
diff --git a/examples/framework-multiple/src/components/solid/SolidCounter.tsx b/examples/framework-multiple/src/components/solid/SolidCounter.tsx
index 153feaddc..cb9219608 100644
--- a/examples/framework-multiple/src/components/solid/SolidCounter.tsx
+++ b/examples/framework-multiple/src/components/solid/SolidCounter.tsx
@@ -1,9 +1,9 @@
/** @jsxImportSource solid-js */
-import { createSignal } from 'solid-js';
+import { createSignal, type JSX } from 'solid-js';
/** A counter written with Solid */
-export default function SolidCounter({ children }) {
+export default function SolidCounter(props: { children?: JSX.Element }) {
const [count, setCount] = createSignal(0);
const add = () => setCount(count() + 1);
const subtract = () => setCount(count() - 1);
@@ -15,7 +15,7 @@ export default function SolidCounter({ children }) {
<pre>{count()}</pre>
<button onClick={add}>+</button>
</div>
- <div class="counter-message">{children}</div>
+ <div class="counter-message">{props.children}</div>
</>
);
}