-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Add a global ErrorBoundary #9799
Conversation
docs/Admin.md
Outdated
| `darkTheme` | Optional | `object` | `default DarkTheme` | The dark theme configuration | | ||
| `defaultTheme` | Optional | `boolean` | `false` | Flag to default to the light theme | | ||
| `disableTelemetry` | Optional | `boolean` | `false` | Set to `true` to disable telemetry collection | | ||
| `error` | Optional | `(props: FallbackProps) => Component` | - | A React component rendered in the content area in case of error | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the type is too precise and therefore takes too much space. Use Component
as for the other similar props
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether we should also remove the existing ErrorBoundary from the Layout now that we have this new one. @fzaninotto?
I think we should keep the one on the layout, because it allows users to navigate using the menu after an error. |
Problem
Some errors raised in the AppBar or the Side Menu break the application in an ugly way. The error boundary in the default layout doesn't work in this case because it is designed to replace only the main content and keep rendering the navigation menu to let users change location.
Solution
Add a global ErrorBoundary before rendering the layout to catch errors in the Chrome.
TODO
Layout.md
Admin.md
/ra-core/src/core/CoreAdminUI.tsx
/ra-core/src/core/CoreAdmin.tsx
/ra-ui-materialui/src/AdminUI.tsx
/react-admin/src/Admin.tsx
CoreAdminUI.tsx