This component tracks how many browser resize events have occurred.
Initially it seems to work correctly. However, after the component updates, resize events begin increasing the counter more than once per event.
For example:
First resize -> 1
Second resize -> 3
Third resize -> unexpected...
A single browser event should cause exactly one state update.
Fix the component so that:
- The count starts at 0.
- One resize increases it to 1.
- Every additional resize increments it by exactly one.
- The component doesn't accumulate duplicate event listeners.