All 35 Bugs /
0/35 Fixed ✓
ReactEasy~10 min

Missing Cleanup on window.addEventListener("resize")

What's Broken (Symptom)

Every component mount attaches another global `resize` listener without calling `removeEventListener` on unmount, multiplying callback executions.

Expected Behavior

  • • Store the exact listener function reference and call `target.removeEventListener("resize", onResize)` in the cleanup returned by `mountResizeTracker`.

Debugging Hints (0/2 used)

Try spotting the bug in the editor first. Need a nudge? Reveal Hint 1 anytime.

Root Cause Breakdown

Pass all 1 automated verification checks on the right to unlock the full Root Cause explanation.

Automated Bug Verification

1 Checks Ready
  • Detaches global resize listener cleanly upon unmountFiring resize after unmount does not invoke callback.
bugfix.js
Live Sandboxed PreviewCtrl + Enter to verify
Console Output0 log(s)
No console output yet. Run Preview or Verify Bug Fix.