diff --git a/code/lib/docs-tools/src/argTypes/docgen/utils/docgenInfo.ts b/code/lib/docs-tools/src/argTypes/docgen/utils/docgenInfo.ts index ecfda0eafdac..70084ed8ed91 100644 --- a/code/lib/docs-tools/src/argTypes/docgen/utils/docgenInfo.ts +++ b/code/lib/docs-tools/src/argTypes/docgen/utils/docgenInfo.ts @@ -16,5 +16,5 @@ export function getDocgenSection(component: Component, section: string): any { } export function getDocgenDescription(component: Component): string { - return hasDocgen(component) && str(component.__docgenInfo.description); + return hasDocgen(component) ? str(component.__docgenInfo.description) : ''; } diff --git a/code/lib/docs-tools/src/argTypes/utils.ts b/code/lib/docs-tools/src/argTypes/utils.ts index 720ec00d916d..c01818f7c99c 100644 --- a/code/lib/docs-tools/src/argTypes/utils.ts +++ b/code/lib/docs-tools/src/argTypes/utils.ts @@ -11,7 +11,7 @@ export function isTooLongForDefaultValueSummary(value: string): boolean { return value.length > MAX_DEFAULT_VALUE_SUMMARY_LENGTH; } -export function createSummaryValue(summary: string, detail?: string): PropSummaryValue { +export function createSummaryValue(summary?: string, detail?: string): PropSummaryValue { if (summary === detail) { return { summary }; }