/** @jsx h */ /** @jsxFrag Fragment */ import { Fragment, h, render } from "https://esm.sh/preact@10.6.4"; import { useState } from "https://esm.sh/preact@10.6.4/hooks"; const App = () => { const [count, setCount] = useState(0); const countUp = useCallback(() => setCount((prev) => prev + 1), []); const countDown = useCallback(() => setCount((prev) => prev - 1), []); return (
Counter: {count}
+ -
); }; const div = document.createElement("div"); document.body.append(div); render(, div);