Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To be able to catch/process an error at the ErrorBoundary with a toast/log message, but continue to render the application - it would be good if the error is only thrown once.
Currently you can catch the error at the boundary, but if you continue rendering a component that uses useQuery the hook will fail - as it re-emits the error. If the value error was returned similar to useErrorBoundary:false once the query has entered the error state - this would allow the error rendering + error boundary
I am interested in this as i work on a large monorepo application which has mulitiple applications with different requirements (and shared components). Some applications want to use error boundaries to bubble and cause an error page, others want to trigger toasts. So allowing the exception to cause a toast but for the application to continue would be very useful. I understand that onError could be used to trigger toasts, but having the context of the eventbubbling (the error handling will be specific to the boundary that wraps it) would be very useful.
example:
https://codesandbox.io/s/long-shadow-cnsdw?file=/src/App.js
in the example the app will not render beacuse the exception is always thrown
Beta Was this translation helpful? Give feedback.
All reactions