Open t-moennich opened 3 years ago
FYI, we’ve released addon-controls
in Storybook 6.0. Controls are portable, auto-generated knobs that are intended to replace addon-knobs
long term.
Please upgrade and try them out today!
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
Just copied from this very nice detailed explanation in storybookjs/storybook#10692
Until storybookjs/storybook#12561 is resolved, a fix for the type error should be added to v5 :pray:
Describe the bug When using the options knob with
{display: multi-select}
, it is inferring the return type from the values of thevaluesObj
, which need to be strings in order for the multi-select to work. The return type is being inferred asstring
when the multi-select actually returns an array of strings, sostring[]
.To Reproduce Steps to reproduce the behavior:
optionsKnob
with the display set tomulti-select
optionsKnob
returnsExpected behavior Given that the
optionsKnob
returns an array of strings when it is being used as a multi-select, it should return the correct type information:string[]
Screenshots The implementation:
The resulting console log of what
options
is returning:The type error:
The knob used in the UI is correct:
Code snippets
System: