[Bug]: 'Fix debouncing ' solution doesn't work
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- JavaScript
- Estrelas
- 11.8k
- Forks
- 7.9k
- Merge médio
- 1d 11h
- PRs com merge (30d)
- 11
Descrição
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)
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece pela seção vinculada “Fix debouncing” na documentação do React e reproduza o exemplo clicando em dois botões em rápida sucessão. Siga a solução fornecida e verifique se os botões fazem debounce de forma independente; está concluído quando as duas mensagens atrasadas aparecem, em vez de apenas a última.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript, react
- Domínio
- documentation
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100