[Typo]: The mechanism described in "Providing a fallback for server errors and client-only content" behaves differently in practice
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 11.8k
- Fork
- 7.9k
- Merge medio
- 1g 11h
- PR unite (30g)
- 11
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con la sezione di riferimento di React Suspense “Providing a fallback for server errors and client-only content”, in particolare con le due affermazioni riportate tra virgolette sugli errori del server e sulla rinuncia al rendering lato server. Riproduci o verifica il comportamento segnalato in sviluppo e in produzione, incluso l’errore 419, quindi aggiorna la sezione in modo che la spiegazione corrisponda al comportamento osservato e dichiari chiaramente qualsiasi limitazione o approccio supportato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, react
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 68/100