()
| 1 | import { useCounter } from '../hooks/useCounter'; |
| 2 | |
| 3 | export const CounterWithCustomHook = () => { |
| 4 | |
| 5 | const { counter, increment, decrement, reset } = useCounter(); |
| 6 | |
| 7 | |
| 8 | return ( |
| 9 | <> |
| 10 | <h1>Counter with Hook: { counter }</h1> |
| 11 | <hr /> |
| 12 | |
| 13 | <button onClick={ () => increment(2) } className="btn btn-primary">+1</button> |
| 14 | <button onClick={ reset } className="btn btn-primary">Reset</button> |
| 15 | <button onClick={ () => decrement(2) } className="btn btn-primary">-1</button> |
| 16 | |
| 17 | </> |
| 18 | ) |
| 19 | } |
nothing calls this directly
no test coverage detected