diff options
Diffstat (limited to 'examples/with-preact/src/components/Counter.tsx')
-rw-r--r-- | examples/with-preact/src/components/Counter.tsx | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/examples/with-preact/src/components/Counter.tsx b/examples/with-preact/src/components/Counter.tsx deleted file mode 100644 index 7c520b167..000000000 --- a/examples/with-preact/src/components/Counter.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { h, Fragment } from 'preact'; -import { useState } from 'preact/hooks'; - -export default function Counter({ 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> - </> - ); -} |