Wrong type for select(...) in addon-knobs
See original GitHub issueDescribe the bug Prop-Options are typed wrong IMO
export interface SelectTypeOptionsProp {
[key: string]: SelectTypeKnobValue;
}
knobs now only accept a key/value pair instead of e.g. string[]
My story with
selectionMode: select('selectionMode', ['none', 'multiple', 'single'], 'none', undefined),
now fails with
TS2345: Argument of type 'string[]' is not assignable to parameter of type 'SelectTypeOptionsProp'.
Expected behavior No breaking change
Suggestion
Either make it unknown
, any
or add a generic
selectionMode: select<string[]>('selectionMode', ['none', 'multiple', 'single'], 'none', undefined),
System:
- Framework: [angular]
- Addons: [addon-knobs]
- Version: [e.g. 5.2.0-alpha.38]
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (8 by maintainers)
Top Results From Across the Web
@storybook/addon-knobs - npm
Storybook Addon Knobs allow you to edit props dynamically using the Storybook UI. You can also use Knobs as a dynamic variable inside ......
Read more >How can I solve problem with typescript and @storybook ...
The problem is that text does indeed return a string nothing is constraining the user from entering any value you can however use...
Read more >Next-level component showcasing with Storybook controls
According to this discussion, the biggest advantage of controls over knobs is that they are based on args , so Storybook can infer...
Read more >Storybook Docs with mdx support and addon knobs - Medium
We are using the readme addon because we have some more complicated components, and we wanted to write their documentation in markdown for...
Read more >React Storybook Tutorial - 10 - Knobs Addon - YouTube
Courses - https://learn.codevolution.dev/ Support UPI - https://support.codevolution.dev/ Support PayPal ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kroeder got a PR for you to review
closed by #8027