Skip to content

Commit 432c513

Browse files
committed
fix(compiler): 纠正 App 路由中的页面组件名称
1 parent bfcefae commit 432c513

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/compiler/ts-loader.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,14 @@ export default async function TsLoader(
112112
}
113113

114114
const result = (componentList as React.FC[]).map(
115-
(component, i) =>
115+
(component) =>
116116
compile(
117117
component,
118118
{},
119119
{
120120
target:
121121
defaultComponentFunc === component ? options.target : undefined,
122-
name: snakeCase(
123-
component.displayName || component.name || `UnnamedComponent${i}`
124-
),
122+
name: snakeCase(defaultComponentName),
125123
}
126124
) as {
127125
name: string;

0 commit comments

Comments
 (0)