🌄 feat: Add RouteErrorBoundary for Improved Client Error handling (#5396)

* feat: Add RouteErrorBoundary for improved error handling and integrate react-error-boundary package

* feat: update error message

* fix: correct typo in containerClassName prop in Landing component
This commit is contained in:
Marco Beretta 2025-01-24 14:34:44 +01:00 committed by GitHub
parent ed57bb4711
commit b8b7f40e98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 235 additions and 0 deletions

View file

@ -8,6 +8,7 @@ import {
ApiErrorWatcher,
} from '~/components/Auth';
import { AuthContextProvider } from '~/hooks/AuthContext';
import RouteErrorBoundary from './RouteErrorBoundary';
import StartupLayout from './Layouts/Startup';
import LoginLayout from './Layouts/Login';
import dashboardRoutes from './Dashboard';
@ -27,10 +28,12 @@ export const router = createBrowserRouter([
{
path: 'share/:shareId',
element: <ShareRoute />,
errorElement: <RouteErrorBoundary />,
},
{
path: '/',
element: <StartupLayout />,
errorElement: <RouteErrorBoundary />,
children: [
{
path: 'register',
@ -49,9 +52,11 @@ export const router = createBrowserRouter([
{
path: 'verify',
element: <VerifyEmail />,
errorElement: <RouteErrorBoundary />,
},
{
element: <AuthLayout />,
errorElement: <RouteErrorBoundary />,
children: [
{
path: '/',