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.1.4 generates infinite loop #13242
Comments
Do you have a repro repo you can share? Or at least the definitions for |
Here is the story I wrote
The Button component:
Am I missing anything? |
btw I'm using React 17 |
Thanks @Shawnxkwang that helps. I think this is a bug:
args is an object but you're spreading it into an array. I think you want:
Assuming each value in the buttons array should be passed into a |
Sorry for the confusion. That part is the official doc that I followed, please see this reply for the real code I wrote. |
Here's what I'm thinking:
I'll add the cycle check in 6.2. Separately, the documentation with the spread args looks wrong and probably needs to be updated @jonniebigodes |
Yippee!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.7 containing PR #13263 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
@shilman looking at this as is indeed is incorrect. I believe that the correct code should be: buttons: [
{ ...ButtonStories.Primary.args },
{ ...ButtonStories.Secondary.args }
],
orientation: "horizontal" With this we can preserve the args incoming from the Button.stories that are imported in this case. I'm going to update the snippet and submit a pull request. |
Describe the bug
To Reproduce
Steps to reproduce the behavior:
official doc
https://storybook.js.org/docs/react/writing-stories/introduction#using-args
Expected behavior
I'd expect it to just work when I follow the official doc.
Screenshots
Code snippets
see above.
System
Please paste the results of
npx sb@next info
here.Additional context
The text was updated successfully, but these errors were encountered: