Training Grounds
Cleanup That Fires Too EarlyBlue Belt
+25 Ki
Description

A counter ticks up every second. It should start from 0 and increment by 1 each second indefinitely. The counter displays 0 and never moves.

Anomaly

The counter is stuck at 0 forever. It never starts ticking. The component renders without error but the interval appears to have no effect.

Constraint
Fix only the cleanup return syntax — do not change the interval duration or tick logic
Do not add any new state or hooks
Hint

Look carefully at the return statement inside useEffect — is the cleanup a function that will be called later, or is something being called right now?

Consult the SenseiOnly for those truly stuck · Flip to reveal

Look carefully at the return statement inside useEffect — is the cleanup a function that will be called later, or is something being called right now?

Loading editor…
Correct Solution
Loading...
Expected OutputGoal State
Your OutputLive