Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Failed prop type: Invalid prop knob.value of type number supplied to RadiosType, expected string. #11325

Closed
dnasir opened this issue Jun 26, 2020 · 3 comments

Comments

@dnasir
Copy link

dnasir commented Jun 26, 2020

Describe the bug
When using the radios addon knob with type number as the values, the following error is displayed in the browser console.

Warning: Failed prop type: Invalid prop `knob.value` of type `number` supplied to `RadiosType`, expected `string`

Additionally, the radio buttons stop displaying the selected state, albeit still registering the state changes.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new story.
  2. Add a radios knob with the following options.
stateKnob: {
  default: radios(
    'Marker state',
    {
      None: 0,
      Selected: 1,
      Unselected: 2
    },
    0
  )
},
  1. Serve the storybook project.
  2. See error in console.
Warning: Failed prop type: Invalid prop `knob.value` of type `number` supplied to `RadiosType`, expected `string`.
    in RadiosType (created by PropForm)
    in PropForm (created by KnobPanel)
    in div (created by SimpleBar)
    in div (created by SimpleBar)
    in div (created by SimpleBar)
    in div (created by SimpleBar)
    in div (created by SimpleBar)
    in div (created by SimpleBar)
    in SimpleBar
    in Unknown (created by Context.Consumer)
    in Styled(Component) (created by ScrollArea)
    in ScrollArea
    in Unknown (created by Context.Consumer)
    in Styled(Component) (created by KnobPanel)
    in KnobPanel
    in div (created by Context.Consumer)
    in Styled(div)
    in div (created by Context.Consumer)
    in Styled(div)
    in Unknown
    in Unknown
    in Unknown
    in Unknown (created by Context.Consumer)
    in ManagerConsumer (created by _default)
    in _default (created by Layout)
    in div (created by Context.Consumer)
    in Styled(div) (created by Panel)
    in Panel (created by Layout)
    in div (created by Context.Consumer)
    in Styled(div) (created by Main)
    in div (created by Context.Consumer)
    in Styled(div) (created by Main)
    in Main (created by Layout)
    in Layout (created by Context.Consumer)
    in WithTheme(Layout)
    in Unknown
    in Unknown
    in div (created by Context.Consumer)
    in Styled(div)
    in Unknown
    in Unknown (created by SizeMeRenderer(Component))
    in SizeMeReferenceWrapper (created by SizeMeRenderer(Component))
    in SizeMeRenderer(Component) (created by SizeMe(Component))
    in SizeMe(Component) (created by Manager)
    in ThemeProvider (created by Manager)
    in Manager (created by Context.Consumer)
    in Location (created by QueryLocation)
    in QueryLocation (created by Root)
    in LocationProvider (created by Root)
    in HelmetProvider (created by Root)
    in Root

Expected behavior
No errors should be displayed, and the radio buttons should fully function, both visually and programmatically.

System:

Environment Info:

  System:
    OS: macOS 10.15.5
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Binaries:
    Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
    npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
  Browsers:
    Chrome: 83.0.4103.116
    Firefox: 74.0
    Safari: 13.1.1
  npmPackages:
    @storybook/addon-actions: ^5.3.18 => 5.3.18 
    @storybook/addon-knobs: ^5.3.18 => 5.3.18 
    @storybook/addon-links: ^5.3.18 => 5.3.18 
    @storybook/addon-notes: ^5.3.18 => 5.3.18 
    @storybook/addon-viewport: ^5.3.18 => 5.3.18 
    @storybook/core: ^5.3.18 => 5.3.18 
    @storybook/vue: ^5.3.18 => 5.3.18 
@shilman
Copy link
Member

shilman commented Jun 27, 2020

FYI, we’ve released addon-controls in 6.0-beta. Controls are portable, auto-generated knobs that are intended to replace addon-knobs long term.

Please upgrade and try them out today!

@stale
Copy link

stale bot commented Jul 18, 2020

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!

@stale stale bot added the inactive label Jul 18, 2020
@stale
Copy link

stale bot commented Aug 22, 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!

@stale stale bot closed this as completed Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants