Skip to content

Commit

Permalink
feat(projects): by default, the error boundary is placed on the root …
Browse files Browse the repository at this point in the history
…path
  • Loading branch information
Ohh-889 committed Aug 8, 2024
1 parent 991b1c0 commit e11d19d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/route-core/dts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ declare module "@elegant-router/types" {
? Omit<ElegantConstRoute, 'children'> & {
name: K;
path: RouteMap[K];
component: \`${LAYOUT_PREFIX}\${RouteLayout}$${VIEW_PREFIX}\${K}\`| \`${VIEW_PREFIX}\${LastLevelRouteKey}\`;
component: \`${LAYOUT_PREFIX}\${RouteLayout}$${VIEW_PREFIX}\${K}\`| \`${VIEW_PREFIX}\${LastLevelRouteKey}\`|\`${LAYOUT_PREFIX}\${RouteLayout}\`;
children?:ElegantConstRoute[] ;
layout?:${layoutType}
}
Expand Down Expand Up @@ -257,7 +257,7 @@ declare module "@elegant-router/types" {
? Omit<ElegantConstRoute, 'children'> & {
name: K;
path: RouteMap[K];
component?: \`${VIEW_PREFIX}\${LastLevelRouteKey}\`| \`${VIEW_PREFIX}\${LastLevelRouteKey}\`;
component?: \`${VIEW_PREFIX}\${LastLevelRouteKey}\`;
layout?:${layoutType}
}
: never;
Expand Down
4 changes: 2 additions & 2 deletions src/route-core/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import type { FunctionComponent } from "react";
import type { ElegantConstRoute } from '@ohh-889/react-auto-route';
import type { RouteMap, RouteKey, RoutePath } from '@elegant-router/types';
import { redirect } from 'react-router-dom'
import ErrorBoundary from '@/pages/_builtin/error'
import ErrorBoundary from '../../../ErrorBoundary.tsx'
type CustomRouteObject = Omit<RouteObject, 'Component'|'index'> & {
Expand Down Expand Up @@ -177,7 +177,7 @@ export function transformElegantRouteToReactRoute(
const data= (await views[viewName]()).Component as FunctionComponent
return {
element: data(props) ,
ErrorBoundary
ErrorBoundary: null
}
}
} else {
Expand Down

0 comments on commit e11d19d

Please sign in to comment.