-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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]: options: any[]
in argTypes is not sufficient
#26912
Comments
Having same issues but with latest SB version you no longer need to set options as before. You will get those automatically. |
I think simply making I'd make a PR for this and test it, but I'm struggling to find where this is defined. I can see it published in EDIT: I found it. It's https://github.com/ComponentDriven/csf. I think this was introduced in ComponentDriven/csf@ab72fee |
I've opened ComponentDriven/csf#85 which from my testing resolves this. |
Great! Do we also need a PR in storybook to address the dependency upgrade? I'm a bit of a OS / Storybook noob, so not completely sure what the best approach is. |
Hello, We are also experiencing this issue with 8.0.9 when using an enum as the value for the options property against an argType. Previously ok and now throwing same error as above:
Removing the options property does not automatically give the correct enum as options even through it is specified in the prop types for the component. Control in Storybook gives "-". Manually specifying individual enum items in an array in the options property does still work e.g.
Do we need to change our technique for the options property or is this a bug with the new version? Many thanks. |
There will need to be a PR here too yes, once that PR for |
Once #26958 is merged and a storybook release is out, that should resolve this moving forward. |
Describe the bug
I am defining a story with
argTypes
and using a control in which we want to reference an array of options for a certain prop like so:This worked fine before, but since v9, it's causing typescript issues for
argTypes
:This seems incorrect to me, because options is not mutable AFAIK. This is causing a lot of issues in our whole codebase which I now have to solve or use
@ts-expect-error xxx
.To Reproduce
Will add later
System
Additional context
No response
The text was updated successfully, but these errors were encountered: