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.

After Refactoring Storybook Stories Into TypeScript, 'select' Knob Add-on No Longer Works

See original GitHub issue

Describe 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:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ndelangencommented, Dec 21, 2019

@emilio-martinez could you take a look at this?

0reactions
stale[bot]commented, Feb 10, 2020

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Storybook - no stories showing up in typescript project with ...
It seems like the babel plugin transform-es2015-modules-amd doesn't fit right with storybook since sb still uses your babel configuration.
Read more >
The Ultimate Guide to Storybook for React Applications
In this article, you'll get an overview of what Storybook is, its use cases and how to integrate the tool into your front...
Read more >
@storybook/addon-controls | Yarn - Package Manager
Storybook Controls gives you a graphical UI to interact with a component's arguments dynamically, without needing to code. It creates an addon panel...
Read more >
Test Driven Development (TDD) with React, React Testing ...
Test Driven Development (TDD) is an essential tool for writing robust code, especially in larger teams, we look at how to get started....
Read more >
React Storybook Controls - The easy way - DEV Community ‍ ‍
Storybook is an open source tool for building UI components and pages in isolation. It streamlines UI... Tagged with react, storybook, ...
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