You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom Error View and Message in Not Working as Expected
When using the component with a view prop to provide a custom error view (e.g., it is directly showing ErrorView component when page gets loaded first irrespective of error.
I tried couple of ways but still I have the same problem with it. Could you please suggest me how can I show a generic message on UI when error was occured in the application.
Based on your description, it seems the issue might be that the ErrorBoundary component is always rendering the ErrorView, even when no error has occurred. This could happen if there’s no condition in your custom view prop to check for the presence of an error.
Here’s what to verify:
Your custom view should include a check for the error property. For example: const CustomErrorView = ({ error, children }) => { return error ? <div>{error}</div> : children; };
Ensure that the ErrorBoundary is initialized correctly with the custom view:
`
Some Content
`
If you’ve already added such a condition but the issue persists, please share the view code for ErrorBoundary and how it’s being initialized in your application. That would help identify the root cause more easily.
Custom Error View and Message in Not Working as Expected
When using the component with a view prop to provide a custom error view (e.g., it is directly showing ErrorView component when page gets loaded first irrespective of error.
I tried couple of ways but still I have the same problem with it. Could you please suggest me how can I show a generic message on UI when error was occured in the application.
#990
The text was updated successfully, but these errors were encountered: