Storybook: Typescript props table overflow

Created on 10 May 2020  路  4Comments  路  Source: storybookjs/storybook

Describe the bug
More complex Typescript types such as:

ComponentClass<ClassAttributes<HTMLInputElement> & InputHTMLAttributes<HTMLInputElement> & { classes?: { ...; } | undefined; }, any> | FunctionComponent<...> | undefined

are causing overflow in the props tables.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the Storybook Design System
  2. Replace one of the types provided with the Typescript type above in the inspector.
  3. Shrink the window to about 750px wide with the sidebar or about 620px without the sidebar.

Expected behavior
Ideally the props table would display a type closer to what is in source. I'm not sure yet if this is something that's fixed with the switch to react-docgen 馃. Regardless my expectation would be that in the worst-case scenario line-breaks would occur on the start of a generic (<).

Screenshots
Screen Shot 2020-05-09 at 7 07 39 PM

System:
I've foregone this section because I'm seeing this behavior in the public-facing docs as well. I'd be happy to provide this, if needed though! Locally I'm running 5.3.18

props bug inactive typescript

Most helpful comment

We've just released zero-config typescript support in 6.0-beta. Please upgrade and test it!

Thanks for your help and support getting this stable for release!

All 4 comments

Thanks for raising this -- definitely not optimal. I'm reconsidering the switch to react-docgen since it doesn't support imported types currently and that's a dealbreaker for most "real world" use cases. We need to hustle to get something good in place for 6.0 -- quite a pain in the neck.

We've just released zero-config typescript support in 6.0-beta. Please upgrade and test it!

Thanks for your help and support getting this stable for release!

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!

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sakulstra picture sakulstra  路  3Comments

purplecones picture purplecones  路  3Comments

Jonovono picture Jonovono  路  3Comments

rpersaud picture rpersaud  路  3Comments

tomitrescak picture tomitrescak  路  3Comments