storybookjs/storybook

[Bug]: Autodocs "union" type

オープン

#25,305 opened on 2023/12/22

 (9 件のコメント) (1 件のリアクション) (0 人の担当者)TypeScript (10,058 件のフォーク)batch import
argtypesbughelp wantedreacttypescript

Repository metrics

Stars
 (89,909 個のスター)
PR merge metrics
 (平均マージ 7d 22h) (30d で 184 merged PRs)

説明

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

コントリビューターガイド