question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong type for select(...) in addon-knobs

See original GitHub issue

Describe 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]

cc @emilio-martinez

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
emilio-martinezcommented, Jul 9, 2019

@kroeder got a PR for you to review

0reactions
Evaloncommented, Sep 9, 2019

closed by #8027

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found