Skip to content

Commit db47c29

Browse files
committed
chore(scripts): 修复new-component脚本的props固定是DividerProps的bug
1 parent d5f51a5 commit db47c29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/new-component.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,12 @@ export const ${componentName}: React.FC<${props}> = (props) => {
7676
return [filename, content];
7777
}
7878
function initTypes(): InitRes {
79+
const props = `${config.componentName}Props`;
7980
const filename = getFilename('types');
8081
const content = `
8182
import React from 'react';
8283
83-
export type DividerProps = React.HTMLAttributes<HTMLElement> & {
84+
export type ${props} = React.HTMLAttributes<HTMLElement> & {
8485
name?: string;
8586
};
8687
`;

0 commit comments

Comments
 (0)