diff options
Diffstat (limited to 'examples/framework-multiple/src/components/PreactCounter.tsx')
-rw-r--r-- | examples/framework-multiple/src/components/PreactCounter.tsx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/examples/framework-multiple/src/components/PreactCounter.tsx b/examples/framework-multiple/src/components/PreactCounter.tsx index 9c9bf73a1..261f275a1 100644 --- a/examples/framework-multiple/src/components/PreactCounter.tsx +++ b/examples/framework-multiple/src/components/PreactCounter.tsx @@ -2,18 +2,18 @@ import { useState } from 'preact/hooks'; /** a counter written in Preact */ export function PreactCounter({ children }) { - const [count, setCount] = useState(0); - const add = () => setCount((i) => i + 1); - const subtract = () => setCount((i) => i - 1); + const [count, setCount] = useState(0); + const add = () => setCount((i) => i + 1); + const subtract = () => setCount((i) => i - 1); - return ( - <> - <div class="counter"> - <button onClick={subtract}>-</button> - <pre>{count}</pre> - <button onClick={add}>+</button> - </div> - <div class="counter-message">{children}</div> - </> - ); + return ( + <> + <div class="counter"> + <button onClick={subtract}>-</button> + <pre>{count}</pre> + <button onClick={add}>+</button> + </div> + <div class="counter-message">{children}</div> + </> + ); } |