Codex React timer cleanup and resource review
Trace React effects through dependency changes and unmounting to find timers or subscriptions left active.
中文Install in Codex
Codex with a React lifecycle excerpt or a reproducible local fixture.
- Review `.agents/skills/memory-leak-review-agent/SKILL.md` and its requirements at the pinned GitHub commit.
- Create `.agents/skills/memory-leak-review-agent/` in your project and save the reviewed file as `.agents/skills/memory-leak-review-agent/SKILL.md`.
- Start Codex from that project's root, then type `$memory-leak-review-agent` and select the matching skill.
Example task
Review state polling on unmount. The effect starts a timer without returning a cleanup function.
{"component":"StatusTicker","periodMs":500,"unmountAfterMs":250,"cleanup":false}What to check
The timer from `StatusTicker` stays active after unmount. Release that timer with `clearInterval`, advance the clock after unmount, and expect 0 additional callbacks.
Original SKILL.md on GitHub · Updated
Frequently asked question
Why advance a simulated clock after unmount?
It checks whether polling continues after the component leaves. The same test can verify timer cleanup.