App

Bundles

Stats
BundleMinifiedGzipBrotli
index.js11 kB4.4 kB4.04 kB

Source

import { render } from "preact";
import { useState } from "preact/hooks";

function App() {
	const [count, setCount] = useState(0);
	return (
		<button
			class="btn badge"
			data-badge={count}
			style="margin-top: .5rem"
			onClick={() => setCount(count + 1)}
		>
			count: {count}
		</button>
	);
}

render(<App />, document.getElementById("app"));