Document we should probably use React.memo under our Context Provider
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
It is not immediately obvious that when the component that declares the context provider re-renders, all its descendants will also render, and not just the components that subscribe to the context.
This has been made explicit by @sophiebits on Twitter: https://twitter.com/sophiebits/status/1228942768543686656, and @markerikson on his blog: https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/#context-updates-and-render-optimizations, but following the right people on twitter should not be a requirement to understand how React is supposed to be used.
While it's true that if one reasons about how React decides to render components (given one has a sufficient understanding of it) this behaviour can be inferred, I still think that an explicit recommendation would help a majority of React users.
Happy to try submitting a PR if needed :)
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
Nenhum arquivo ou teste específico é indicado. Localize as orientações sobre React Context Provider na documentação do react.dev e revise as referências de renderização vinculadas; considera-se concluído quando a documentação explica claramente as novas renderizações dos descendentes e declara a recomendação pretendida para React.memo.
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
- 42/100