[Suggestion]: Adding an Explanation Text to Avoid any Confusion
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 62/100
- Issue-Typ
- Dokumentation
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- javascript, react
- Bereich
- documentation
Rechercherichtung
Öffne die Seite react.dev/learn/render-and-commit und untersuche „Step 3: React commits changes to the DOM“, insbesondere den Satz über das erneute Rendern mit anderen Props und das dazugehörige Playground. Vergleiche sie mit der verlinkten Seite „State as a Snapshot“, aktualisiere dann die Erklärung, sodass die Unterscheidung klar ist, und überprüfe die Dokumentationsvorschau und die Links.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 11.8k
- Forks
- 7.9k
- Ø Merge
- 16 Std. 6 Min.
- Gemergte PRs (30 T.)
- 7
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus reactjs/react.dev
-
type: documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
-
bug: unconfirmed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
-
type: typos
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
-
bug: unconfirmed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Alle Issues in reactjs/react.dev
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Theme loads third-party resources on every page (jsdelivr web font, cdnjs Font Awesome) – GDPR Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
docToolchain/docToolchain#1705 ·
-
Timezone select lists one option per character; duplicate "Failed" reason; shared tracker popover id Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
nightscout/nocturne#1414 ·
-
bug v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
modelcontextprotocol/inspector#2458 · 1 Kommentar ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
carbon-design-system/ibm-products#9907 ·