After Refactoring Storybook Stories Into TypeScript, 'select' Knob Add-on No Longer Works
See original GitHub issueDescribe the bug A clear and concise description of what the bug is.
I have just refactored Storybook stories to be written in TypeScript. Now, the select
add-on method asks for 3 - 4 arguments. When I give it the third argument which is a default for color, the selection box no longer changes the color / works / does anything.
Expected behavior A clear and concise description of what you expected to happen.
I expect to be able to make a selection from using the select
knob and change a color.
Screenshots If applicable, add screenshots to help explain your problem.
Code snippets If applicable, add code samples to help explain your problem.
Here is my previous JS that works:
select('Spinner color', ['green', 'dark'])
Now with TS, I have to add a default, it compiles but it stops the selection knob actually changing anything in the story:
select('Spinner color', ['green', 'dark'], 'dark')
Here are the docs that suggest this should work.
System:
Please paste the results of npx -p @storybook/cli@next sb info
here.
System: OS: macOS Mojave 10.14.5 CPU: (8) x64 Intel® Core™ i7-4770HQ CPU @ 2.20GHz Binaries: Node: 12.3.1 - /usr/local/bin/node Yarn: 1.16.0 - /usr/local/bin/yarn npm: 6.11.3 - /usr/local/bin/npm Browsers: Chrome: 78.0.3904.97 Firefox: 67.0.1 Safari: 12.1.1 npmPackages: @storybook/addon-actions: 5.2.5 => 5.2.5 @storybook/addon-knobs: 5.2.5 => 5.2.5 @storybook/addon-links: 5.2.5 => 5.2.5 @storybook/react: 5.2.5 => 5.2.5
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
@emilio-martinez could you take a look at this?
Hey there, it’s me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!