Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Info Addon - Props table when using nested types with react-docgen-typescript-loader #7661

Closed
affanshahid opened this issue Aug 2, 2019 · 5 comments

Comments

@affanshahid
Copy link

affanshahid commented Aug 2, 2019

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
@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2019

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

@stale
Copy link

stale bot commented Aug 23, 2019

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!

@stale stale bot added the inactive label Aug 23, 2019
@shilman
Copy link
Member

shilman commented Aug 26, 2019

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

@stale stale bot removed the inactive label Aug 26, 2019
@xikobe
Copy link

xikobe commented Jun 8, 2020

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

@vinod-donthi-by
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants