You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just run storybook and there will be two stories of button.
The difference is that the first Button has type in the exact same file as the component, the Button2 uses type from .ts file with the same type.
Current behavior - Button2 does not have ArgsTable.
Expected behavior - Button2 has ArgsTable as Button.
The text was updated successfully, but these errors were encountered:
Note: react-docgen will not be able to grab the type definition if the type is imported or declared in a different file.
So for your example, I wonder if maybe react-docgen is being used instead of react-docgen-typescript. (or maybe react-docgen-typescript has the same limitation).
The ArgTypes docs here make it seem like it would infer the typescript and use react-docgen-typescript, but it isn't explicitly stated that it is smart enough to do so...
@joeycozza Thank you for advice! For my example the problem was fixed by installing typescript. npm i typescript
But, digging into the problem, I found the weird case (also with type import from another file - as it was with Button2 in my example above):
If you have multiple components with displayName in the file, it breaks the ArgsTable, for example
(The problem connected with the first displayName, like it should be always in the end)
Describe the bug
The bug connected with ArgsTable when properties are described through an interface or a type in .ts file that is imported from another module.
To Reproduce
The project uses the 6.4 version of storybook.
I published test repo to reproduce the bug
https://github.com/GlebUrentsev/TestMdxArgsTable
Just run storybook and there will be two stories of button.
The difference is that the first Button has type in the exact same file as the component, the Button2 uses type from .ts file with the same type.
Current behavior - Button2 does not have ArgsTable.
Expected behavior - Button2 has ArgsTable as Button.
The text was updated successfully, but these errors were encountered: