(incrementBy)
| 486 | } |
| 487 | |
| 488 | function useCount(incrementBy) { |
| 489 | const [count, updateCount] = useState(0); |
| 490 | const increment = useEffectEvent(amount => |
| 491 | updateCount(c => c + (amount || incrementBy)), |
| 492 | ); |
| 493 | |
| 494 | return [count, increment]; |
| 495 | } |
| 496 | |
| 497 | function Counter({incrementBy}) { |
| 498 | const [count, increment] = useCount(incrementBy); |
no test coverage detected