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
[Bug]: v7 -> v8 controls tab is missing a lot of information #26496
Comments
It seems the autodocs shows only the args that you use in your first story or defined is the Meta object. All args are not displayed by default anymore. Try to add and set a value in one of your stories you will see it. But for the controls options the problem occurs since they switch from react-docgen-typescript to react-docgen by default. A curious choice... |
@Astarosa explained why you see just an arg, but there are still issues with Description, Default and Control. I managed to get back my Descriptions (which I wrote as JSDocs to my interfaces) by switching to the old |
Thanks for reporting this. We switched to using |
For some reasons controls are broken since V8. Change the version of |
Hey! This issue happened to me too, luckily switching to |
Having the same issue after upgrading to 8.0.4 from 7.6.17 :( |
I'm facing the same issue. It's also hiding the type descriptions. I can manually add them by adding argtypes.field.description but it would be nice if this would be auto generated. |
Update: I just found out that I did not configure reactDocgen correctly in the main.ts. It must be
With this, I can confirm that the documentation is generated properly. |
I noticed that with |
Same for me. When using |
There is some stuff that I found out recently, that might help somebody. When using export const Button = forwardRef<'button', ButtonProps>((props: ButtonProps) => { Even if the second The declaration of props have to be in a plain interface with no magic: export interface ButtonProps {
color?: 'primary' | 'error';
} This works as expected. But in one big project I use polymorphic components and the props are not declared using a simple interface, they are defined like this: export interface ButtonOwnProps {
color?: 'primary' | 'error';
}
export interface ButtonTypeMap<C extends React.ElementType = 'button', P = {}> {
defaultAs: C;
props: P & ButtonOwnProps;
}
export type ButtonProps<
C extends React.ElementType = ButtonTypeMap['defaultAs'],
P = {},
> = OverrideProps<ButtonTypeMap<C, P>, C>; This was working with v7 but does not work with Storybook 8 anymore. Storybook config in main.ts: For one project I was using addons: [
'@storybook/addon-a11y',
{
name: '@storybook/addon-essentials',
options: {
docs: false,
},
},
], In v7 this was fine, but if you use the same in Storybook 8 no controls show up. Also it's not needed anymore, so just remove it or set |
* chore: move to storybook 8 * chore: replace storybook-tailwind-dark-mode with @storybook/addon-themes * chore: use react-docgen-typescript instead of react-docgen https://storybook.js.org/blog/storybook-8/#improved-react-and-vue-control-autogeneration https://storybook.js.org/docs/api/main-config-typescript#reactdocgen storybookjs/storybook#26496 * chore: upgrade eslint-plugin-storybook
… much fewer changes See storybookjs/storybook#26496
Describe the bug
v7: (7.6.17)
v8: (8.0.0)
To Reproduce
Removed a LOT of bloat, but this should do:
System
Additional context
Switching between the two versions (and restarting storybook dev) is enough to trigger this issue - config and code remains untouched
The text was updated successfully, but these errors were encountered: