diff options
Diffstat (limited to 'examples/with-markdown/src/components/PreactCounter.tsx')
-rw-r--r-- | examples/with-markdown/src/components/PreactCounter.tsx | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/examples/with-markdown/src/components/PreactCounter.tsx b/examples/with-markdown/src/components/PreactCounter.tsx deleted file mode 100644 index e67afb4fe..000000000 --- a/examples/with-markdown/src/components/PreactCounter.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { h, Fragment } from 'preact'; -import { useState } from 'preact/hooks'; - -/** a counter written in Preact */ -export default function PreactCounter({ children }) { - const [count, setCount] = useState(0); - const add = () => setCount((i) => i + 1); - const subtract = () => setCount((i) => i - 1); - - return ( - <> - <div className="counter"> - <button onClick={subtract}>-</button> - <pre>{count}</pre> - <button onClick={add}>+</button> - </div> - <div className="children">{children}</div> - </> - ); -} |