digidem / digidem/comapeo-cloud-app
[react-doctor] effect-raf-loop-needs-cancel · src/hooks/useCountUp.ts:101
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 29
Description
React Doctor currently reports 1 finding in src/hooks/useCountUp.ts.
- effect-raf-loop-needs-cancel (warning, L101:22) — This requestAnimationFrame loop can schedule another frame but is never cancelled, so pending work may continue after unmount; store every frame id in one handle and cancel that handle from the returned effect cleanup.
- Fix: Store the frame id and return a cleanup that calls
cancelAnimationFrame(id)so self-scheduling work cannot continue after unmount. - Docs: https://react.doctor/rules/effect-raf-loop-needs-cancel
- Fix: Store the frame id and return a cleanup that calls
This issue is maintained automatically. It will be updated while findings remain and closed when the file is clean.
Human triage notes below this marker are preserved by the weekly audit.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open src/hooks/useCountUp.ts and inspect the requestAnimationFrame loop at L101:22, then read the surrounding effect and its cleanup. Confirm that the frame handle is tracked and cancellation covers pending work after unmount; done means React Doctor no longer reports effect-raf-loop-needs-cancel for this file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100