From e586d7d704d475afe3373a1de6ae20d504f79d6d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:25:23 +0000 Subject: Sync from a8e1c0a7402940e0fc5beef669522b315052df1b --- .../src/components/react/ReactCounter.tsx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 examples/framework-multiple/src/components/react/ReactCounter.tsx (limited to 'examples/framework-multiple/src/components/react/ReactCounter.tsx') diff --git a/examples/framework-multiple/src/components/react/ReactCounter.tsx b/examples/framework-multiple/src/components/react/ReactCounter.tsx new file mode 100644 index 000000000..84681035d --- /dev/null +++ b/examples/framework-multiple/src/components/react/ReactCounter.tsx @@ -0,0 +1,21 @@ +/** @jsxImportSource react */ + +import { useState, type ReactNode } from 'react'; + +/** A counter written with React */ +export function Counter({ children }: { children?: ReactNode }) { + const [count, setCount] = useState(0); + const add = () => setCount((i) => i + 1); + const subtract = () => setCount((i) => i - 1); + + return ( + <> +
{count}+ +