-
Notifications
You must be signed in to change notification settings - Fork 6
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
Make compatible with componentDidCatch #8
Comments
@heygrady basically react-guard was a solution before I hope I answered your question |
I guess what makes react-guard interesting now is that I need to test this out myself but I was wondering if it would be possible to use the basic underpinnings of react-guard to enable a |
@heygrady https://twitter.com/acdlite/status/986029152405827584 I guess it's better to push react team instead :) |
It should be possible to see that a component has a
componentDidCatch
method. It would be nice if react-guard could optionally only catch errors at those error boundaries.The issue is that we want/need to use the client-side error boundary on the client. The official solution allows us to define precisely how the errors are shown. But with react-guard on the server-side, we lose that control.
For example, imagine that the SVG icon in a submit button is throwing an error. On the client I can catch that at the form level and give the user a really nice message that replaces the whole form. This is a great user experience.
By contrast, react-guard would replace only that icon with a generic message. This might lead to a poor user experience.
Forgive me if I am missing something about how react-guard works.
The text was updated successfully, but these errors were encountered: