-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
addon-docs: Props table can't find props when using ComponentProps<typeof X>
.
#9922
Comments
To be honest I don't understand what's captured by the snapshots well enough to see that in them, but that had certainly been my assumption. I filed it here rather than against the dependency because I saw a bunch of other related bugs for which you'd created repro cases and otherwise seemed to have "accepted" them. Thanks! |
@shilman Is there something we should do to keep the stale bot from closing this? |
i've marked it as In this case the 6.0 Next steps, I think, is to file a bug in Would you be up for giving that a shot? |
We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:
|
Describe the bug
When using addon-docs with Storybook, the props table says that it cannot find any props for a component that uses
ComponentProps<typeof OtherComponent>
in its type definition.To Reproduce
Steps to reproduce the behavior:
WrappedButton
component that uses it internally and wishes to proxy props to it.yarn storybook
.Expected behavior
I would expect the props table to list the
spacing
prop from WrappedButton and theonClick
prop from Button.Note that if you remove the
& ComponentProps<typeof Button>
the props table will correctly show thespacing
prop, so it's clearly related to this intersection. If you dotype Props = ComponentProps<typeof Button>
, then the table is still empty. It therefore seems like the props table is unable to show props whenComponentProps<typeof X>
is part of the type definition.Interestingly, if I import Button via
import { Button } from '@storybook/react/demo';
rather than using the local clone of that file, bothspacing
andonClick
correctly show up in the props table.Code snippets
The Props type definition that I'd like to use:
System:
Thanks for building a great tool!
The text was updated successfully, but these errors were encountered: