[Bug]: 'Fix debouncing ' solution doesn't work
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
Summary
https://react.dev/learn/referencing-values-with-refs#fix-debouncing --> Solution --> Try provided solution: Only the last button handler fires after debouncing.
Page
https://react.dev/learn/referencing-values-with-refs#fix-debouncing
Details
https://react.dev/learn/referencing-values-with-refs#fix-debouncing --> Solution --> Try provided solution: Only the last button handler fires after debouncing.
The solution via using useRef doesn't work and has the same issue as in the challenge description: "This example works, but not quite as intended. The buttons are not independent. To see the problem, click one of the buttons, and then immediately click another button. You’d expect that after a delay, you would see both button’s messages. But only the last button’s message shows up. The first button’s message gets lost."
Only the last button handler fires after debouncing.
Checked on:
Win11, Chrome Version 141.0.7390.123 (Official Build) (64-bit)
Contributor guide
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
Start at the linked “Fix debouncing” section in the React documentation and reproduce the example by clicking two buttons in quick succession. Trace the provided solution and verify that the buttons debounce independently; it is done when both delayed messages appear rather than only the last one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100