Skip to content

Commit

Permalink
fix(projects): fixed hook not being used in routing files with parame…
Browse files Browse the repository at this point in the history
…ters & component layout appears undefined
  • Loading branch information
mufeng889 committed Aug 26, 2024
1 parent 0e9496a commit 1cdc3bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/route-core/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,11 @@ export const generatedRoutes: GeneratedRoute[] = [];



if (config.layout||oldRoute.layout) {
updatedRoute.component = 'layout.'+ config.layout||oldRoute.layout;

if (config.layout || oldRoute.layout) {
const layout = config.layout || oldRoute.layout;

updatedRoute.component = `layout.${layout}`;
}else if (oldRoute.component && component) {
if (isFirstLevel) {
const { layoutName: oldLayoutName } = resolveFirstLevelRouteComponent(oldRoute.component);
Expand Down
2 changes: 1 addition & 1 deletion src/route-core/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function transformElegantRouteToReactRoute(
reactRoute.lazy = async () => {
const data= (await views[viewName]()).Component as FunctionComponent
return {
element: data(props) ,
Component: ()=>data(props) ,
ErrorBoundary: null
}
}
Expand Down

0 comments on commit 1cdc3bc

Please sign in to comment.