[Typo]: The mechanism described in "Providing a fallback for server errors and client-only content" behaves differently in practice
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 68/100
- Issue-Typ
- Dokumentation
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- javascript, react
- Bereich
- documentation
Rechercherichtung
Beginnen Sie mit dem React-Suspense-Referenzabschnitt „Providing a fallback for server errors and client-only content“, insbesondere mit den beiden zitierten Aussagen zu Serverfehlern und zum Verzicht auf serverseitiges Rendering. Reproduzieren oder überprüfen Sie das gemeldete Verhalten in Entwicklung und Produktion, einschließlich Fehler 419, und aktualisieren Sie anschließend den Abschnitt so, dass seine Erklärung dem beobachteten Verhalten entspricht und jede Einschränkung oder jeder unterstützte Ansatz klar genannt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
The section "Providing a fallback for server errors and client-only content" could be misleading when it comes to opting out of server-rendering.
Page
Details
The section "Providing a fallback for server errors and client-only content" seems to suggest that if a user wants to explicitly opt out a component/hook out of being rendered on the server, they can throw an error on the server, and when that same component successfully renders on the client, the error will not be surfaced to the user. I am specifically talking about the following statements:
However, if it does not error on the client, React will not display the error to the user since the content was eventually displayed successfully.
You can use this to opt out some components from rendering on the server. To do this, throw an error in the server environment and then wrap them in a boundary to replace their HTML with fallbacks:
That seems to be in opposition to how React behaves in practice. Both in development and in production, the error thrown on the server is surfaced to the developer, and (arguably) the end user through the browser console (Minified error description: https://react.dev/errors/419).
The seems to be no documented way to distinguish an intended opt-out from a user error, and if there is none, I feel like the documentation is a bit misleading.
- 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
-
curation good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
amponce/archive-movie-browser#186 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
clerk/javascript#9852 ·
-
bug p1 tools
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
HarperFast/skills#96 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100