-
-
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
[v6.0.0-beta.28] Storybook with Docs breaks when using components that export HOCs or Styled Components #11176
Comments
It is related from the previous fix. I was mis-leaded by my implementations with lots of forwardRef. I do not think Storybook should try to render components at all. @tmeasday @shilman, any opinion on calling On the other hand, I'm surprised the community is not experiencing this issue as much as us. |
try {
processedComponent = component.render({}).type;
} catch (error) {
processedComponent = component;
} But it's bad... |
@tooppaaa out of curiosity, where in the code is
I'm surprised too, I thought there'd be a bunch of issues with this use case as well 😄 |
Zoinks!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-beta.30 containing PR #11195 that references this issue. Upgrade today to try it out! You can find this prerelease on the Closing this issue. Please re-open if you think there's still more to do. |
Hi, I can reproduce this with "6.0.0-rc.13", could you please clarify the fix? Should I update somthing? Edit: ok all addons needs to have matching version with "@storybook/react", so 6.0.0-rc.13 for instance, that solved it for me :) |
@eric-burel Yes please upgrade with |
Hi here, |
It seems that it reappeared in v18, will retry with v13 because it stopped working for me just after a npm reinstall. I do have an i18n decorator in my config, so I guess some particular hook change in next-i18nnext makes it fail. Hope it'll help to find the underlying issue. |
For me, the error disappears when I remove "@storybook/addon-controls" from the addons list in
Of course, I am now missing the "Controls" tab in the Canvas view. |
@milenaNeumann do you have repro i can look at? |
Sorry, not atm, I'm not allowed to share code from my workplace... |
Describe the bug
Storybook will completely break with Docs enabled if there are stories that are not exported as React components. Original discussion moved here.
To Reproduce
Steps to reproduce the behavior:
addon-docs
Expected behavior
Storybook should work fine with these kind of components. As far as I know this was working in version
6.0.0-alpha.X
.Redefining the exports as below will fix it, but I'd prefer not to change my components to make Docs work.
Code snippets
Dependencies:
Preview.js:
The text was updated successfully, but these errors were encountered: