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
Wrong type for select(...) in addon-knobs #7348
Comments
@kroeder got a PR for you to review |
Olé!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-alpha.39 containing PR #7356 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. |
Still getting wrong type if using with "as const". If "as const" is removed all works properly. Versions: |
@Evalon it looks like Typescript treats |
Yay!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-beta.1 containing PR #7411 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. |
Now error is shown in /node_modules/@storybook/addon-knobs/dist/components/types/Select.d.ts when trying to build by tsc. TS: 3.5.3 (strict) |
also node_modules/@storybook/addon-knobs/dist/components/types/Color.d.ts(2,29): |
I think some of the errors you may be getting are because you're building with the strict flag on—Storybook isn't yet. I'll look into enabling ts strict compilation in that add-on, but that kind of seems like a separate issue. In the meantime, your read-only array use case is covered. |
You right but I think it's kind of regression because with @types/storybook__addon-knobs and storybook 5.2.0-alpha.37 I have proper type and don't get any errors. |
Yeah, totally get where you're coming from. Appreciate the patience 🙏 It's a bit harder here because the types need to actually match with the code, and unfortunately the @types weren't entirely accurate. I actually had some time this morning to start taking a look, so I'm already working on enabling strict in this add-on. Hoping I'll have something to submit soon. |
@emilio-martinez are you on the storybook discord? would love to chat for a few mins about this! |
Yippee!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-beta.6 containing PR #7515 that references this issue. Upgrade today to try it out! You can find this prerelease on the |
In TS 3.6.2 is broken. Error:(35, 26) TS2345: Argument of type 'readonly ("search" | "plus")[]' is not assignable to parameter of type 'SelectTypeOptionsProp<"plus">'. |
closed by #8027 |
Describe the bug
Prop-Options are typed wrong IMO
knobs now only accept a key/value pair instead of e.g.
string[]
My story with
now fails with
Expected behavior
No breaking change
Suggestion
Either make it
unknown
,any
or add a genericSystem:
cc @emilio-martinez
The text was updated successfully, but these errors were encountered: