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

貢獻者指南