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

Display Typescript enums in PropsTable #408

Closed
henrykuzmick opened this issue Oct 14, 2018 · 2 comments
Closed

Display Typescript enums in PropsTable #408

henrykuzmick opened this issue Oct 14, 2018 · 2 comments

Comments

@henrykuzmick
Copy link

Hey! Thanks for this package, it's damn awesome!

I'm not quite sure if this is a bug or a feature request, but here goes:
When using Typescript and defining an enum prop like this:

type Props = {
  tag: 'h1' | 'h2' | 'h3' | 'p' | 'span';
}

I can then use PropsTable and see enum as a result. This allows me to hover and see possible inputs.
This is awesome, but it kind of breaks when I define a props like this:

type Tag = 'h1' | 'h2' | 'h3' | 'p' | 'span';
type Props = {
  tag: Tag
}

In this case the props table just says Tag.
It would be great if I could hover over it and see the possible values, just like in the first case.

Thanks!

@pedronauck
Copy link
Member

Yeah, this is another bug around react-docgen 😕I'll close this issue in favor of #240 that contain all this bugs on it ✌️

@NasraMohammad
Copy link

Hi, we were wondering if this is possible yet, or is it due to this bug?
We have looked into issue #240, but we're not sure if this has been closed or not as still seeing it, and thought it most relevant to post here as same use case.
Thanks
https://stackoverflow.com/questions/56515660/docz-how-to-render-typescript-definitions-other-than-interfaces-as-props

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

No branches or pull requests

3 participants