[Suggestion]: Adding an Explanation Text to Avoid any Confusion
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 62/100
- Tipo de issue
- Documentação
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- javascript, react
- Domínio
- documentation
Direção de pesquisa
Abra a página react.dev/learn/render-and-commit e examine “Step 3: React commits changes to the DOM”, especialmente a frase sobre renderizar novamente com props diferentes e seu playground. Compare-a com a página vinculada “State as a Snapshot”, depois atualize a explicação para que a distinção fique clara e verifique a visualização da documentação e os links.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
Add an explanation text to avoid any confusion about the fact that it's the component's internal state changes, not the props themselves, that actually trigger the render (cf : the Big Re-renders Myth as mentioned by Nadia Makarevich).
Page
https://react.dev/learn/render-and-commit
Details
Section : "Step 3: React commits changes to the DOM"
In this section, there is a sentence which could create some confusion for a new React Developer.
Indeed, even if it is recalled various times in this page, this sentence could bring some confusion since it is not clearly established that a re-render is triggered by state changes instead of props. Therefore, I suggest to add some short explanations to explicitly clarify this distinction.
This is also a good way to create a common thread with the next page "State as a Snapshot".
Moreover, the playground doesn't help to understand this distinction since we don't use any useState hook in this component but in the parent component (we have to fork it to see all the components):
- The original sentences :
React only changes the DOM nodes if there’s a difference between renders. For example, here is a component that re-renders with different props passed from its parent every second.
- The additional sentence :
It's worth noting that although props are updated, it's the component's internal state changes that actually trigger the render.
- Linguagem predominante
- JavaScript
- Estrelas
- 11.8k
- Forks
- 7.9k
- Merge médio
- 16h 6min
- PRs com merge (30d)
- 7
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.
Mais de reactjs/react.dev
-
type: documentation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
-
bug: unconfirmed
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
-
type: typos
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
-
bug: unconfirmed
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Todas as issues de reactjs/react.dev
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
bevyengine/bevy-website#2595 ·