Skip to content
← Public packages

@kentcdodds/package-app-kit

Design tokens, PWA install/update, About/version, cache helpers, and optional realtime notes sync for Kody package apps.

FollowFork

starter-tanstack/app/ui/counter.tsx

15 lines · 422 B · TypeScript
import { useState } from 'react'

/** Interactive counter — demonstrates client React state after hydration. */
export function Counter({ initialCount, label }: { initialCount: number; label: string }) {
	const [count, setCount] = useState(initialCount)
	return (
		<button
			type="button"
			className="pak-btn pak-btn-accent"
			onClick={() => setCount((value) => value + 1)}
		>
			{label}: {count}
		</button>
	)
}