-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Request] Set error boundary for component subtrees #950
Comments
This was something I had wanted to look into for a while. The SO snippets above look pretty straightforward - maybe we can get a single error boundary in place within the |
I think this can be closed now. There might be more places where this technique can be applied but it has been working well for some time as it is. |
Describe the feature
Sometimes, if there are something wrong (e.g. bugs or local storage is tampered with invalid values), the console will crash with plain screen.
This is not very nice UX. We should show some error message so that the users can move on to other views and also report the issue quickly without tracing browser console.
Any other information?
See https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary
Though we need to consider where to put the boundary so that its not redundant: https://aweary.dev/fault-tolerance-react/
Attention
From: https://stackoverflow.com/questions/48482619/how-can-i-make-use-of-error-boundaries-in-functional-react-components
The text was updated successfully, but these errors were encountered: