Incorrect sentence in `useSyncExternalStore`
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
The documentation of the subscribe argument of useSyncExternalStore states the following (emphasis mine):
subscribe: A function that takes a single callback argument and subscribes it to the store. When the store changes, it should invoke the provided callback. This will cause the component to re-render. The subscribe function should return a function that cleans up the subscription.
As far as I understand, it is not correct that invoking the callback will cause the component to re-render, it is only if the snapshot also changed that the component will re-render. Otherwise it would make a library like Redux unusable if every connected component re-rendered at every store change.
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 da documentação do React sobre o argumento subscribe de useSyncExternalStore e verifique o comportamento do callback e do snapshot descrito na issue. Atualize a frase imprecisa para refletir que uma nova renderização depende de o snapshot mudar; está concluído quando a documentação não afirmar mais que toda invocação do callback renderiza novamente o componente.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- react
- Domínio
- documentation
- Tipo de issue
- Documentação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100