From 100105577f857c0436e72ba853095781ee11c8c6 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kaiser Date: Mon, 2 Jan 2023 10:54:52 +0100 Subject: [PATCH] [no ci] [Doc] Better explain custom error page limitations --- docs/Theming.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/Theming.md b/docs/Theming.md index 1bab6dfb332..dfb2dbde649 100644 --- a/docs/Theming.md +++ b/docs/Theming.md @@ -1071,14 +1071,14 @@ const MyError = ({ {process.env.NODE_ENV !== 'production' && (

{translate(error.toString())}

- {errorInfo.componentStack} + {error.componentStack}
)}
@@ -1115,6 +1115,8 @@ const App = () => ( ); ``` +**Tip:** [React's Error Boundaries](https://reactjs.org/docs/error-boundaries.html) are used internally to display the Error Page whenever an error occurs. Error Boundaries only catch errors during rendering, in lifecycle methods, and in constructors of the components tree. This implies in particular that errors during event callbacks (such as 'onClick') are not concerned. Also note that the Error Boundary component is only set around the main container of React Admin. In particular, you won't see it for errors thrown by the [sidebar Menu](./Menu.md), nor the [AppBar](#customizing-the-appbar-content). This ensures the user is always able to navigate away from the Error Page. + ## Loading Display a circular progress component with optional messages. Display the same loading component as `react-admin` on custom pages for consistency.