Storybook: Info Addon - Props table when using nested types with react-docgen-typescript-loader

Created on 2 Aug 2019  路  5Comments  路  Source: storybookjs/storybook

Describe the bug
I have followed the storybook docs to enable auto generation of the prop types table for my components. Things are working but there is a slight issue when I use separate nested types.
For example with the following props:

export type TaskInfo = {
  id: string;
  title: string;
  state: 'TASK_INBOX' | 'TASK_PINNED' | 'TASK_ARCHIVED';
  updatedAt: Date;
}

export type TaskProps = {
  task: TaskInfo;
  onArchiveTask: (id: string) => void;
  onPinTask: (id: string) => void;
}

I get the following table:
image

the type of the task property is TaskInfo without showing the details of TaskInfo anywhere. Is it possible to somehow show details of TaskInfo or display the structure of TaskInfo as the type instead?

System:

  System:
    OS: Windows 10
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 12.2.0 - D:\Program Files\nodejs\node.EXE
    npm: 6.9.0 - D:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 42.17134.1.0
info feature request

Most helpful comment

Did you manage to achieve this? I'm trying to do the same but could not get around to do it

All 5 comments

Automention: Hey @elevatebart @shilman, you've been tagged! Can you give a hand here?

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

FYI addon-info聽is being superceded by聽addon-docs, which fixes a bunch of bugs and is easier to maintain. It鈥檚 reached release candidate (RC) status and will be properly released soon. Please give it a try!聽https://medium.com/storybookjs/storybook-docspage-e185bc3622bf

Did you manage to achieve this? I'm trying to do the same but could not get around to do it

Is this issue fixed? Do we have a way to display nested types?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

purplecones picture purplecones  路  3Comments

sakulstra picture sakulstra  路  3Comments

tlrobinson picture tlrobinson  路  3Comments

wahengchang picture wahengchang  路  3Comments

arunoda picture arunoda  路  3Comments