storybookjs/storybook

[Bug]: Autodocs "union" type

开放

#25,305 创建于 2023年12月22日

 (9 条评论) (1 个反应) (0 位负责人)TypeScript (10,058 个派生)batch import
argtypesbughelp wantedreacttypescript

仓库指标

星标
 (89,909 个星标)
PR 合并指标
 (平均合并 7天 22小时) (30 天内合并 184 个 PR)

描述

Describe the bug

I have defined some props on the component with union. For example:

export interface MyComponentProps { title: string; subtitle?: string | undefined; }

I wrote a story for my component, added "autodocs" to tags and Storybook generated controls but for prop subtitle I got type union. I expected to see string | undefined.

To Reproduce

Add prop type for example string | undefined.

System

storybook: 7.6.5 @storybook/vue3: 7.6.5 @storybook/vue3-vite: 7.6.5

Additional context

No response

贡献者指南