fix(storybook): do not add Story args when the default value cannot be inferred (#7754)

This commit is contained in:
Juri Strumpflohner 2021-11-18 18:58:27 +01:00 committed by GitHub
parent 55d68718d3
commit 97e154401b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -41,6 +41,9 @@ export class TestButtonComponent {
@Input() style: ButtonStyle = 'default';
@Input() age?: number;
@Input() isOn = false;
@Input() message: string | undefined;
@Input() anotherProp: any;
@Input() anotherNeverProp: never;
}`
);
});

View File

@ -31,7 +31,7 @@ export function componentStoryGenerator(
generateFiles(tree, templatesDir, destinationDir, {
componentFileName: componentFileName,
componentName: componentName,
props,
props: props.filter((p) => typeof p.defaultValue !== 'undefined'),
tmpl: '',
});
}