storybookjs/storybook

[Bug]: Autodocs "union" type

Aberta

#25.305 aberto em 22 de dez. de 2023

 (9 comentários) (1 reação) (0 responsável)TypeScript (10.058 forks)batch import
argtypesbughelp wantedreacttypescript

Métricas do repositório

Stars
 (89.909 estrelas)
Métricas de merge de PR
 (Mesclagem média 7d 22h) (184 fundiu PRs em 30d)

Description

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

Guia do colaborador