addon-smart-knobs icon indicating copy to clipboard operation
addon-smart-knobs copied to clipboard

boolean knobs renders as string in Storybook

Open zurmoehle opened this issue 4 years ago • 0 comments

This are my PropTypes:

Audio.propTypes = {
  className: PropTypes.string,
  src: PropTypes.string,
  index: PropTypes.string,
  title: PropTypes.string,
  subline: PropTypes.string,
  details: PropTypes.object,
  defaultOpen: PropTypes.bool,
  defaultActive: PropTypes.bool,
  defaultMuted: PropTypes.bool,
}

Audio.defaultProps = {
  className: '',
  src: '',
  index: '',
  title: '',
  subline: '',
  details: {},
  defaultOpen: false,
  defaultActive: false,
  defaultMuted: false,
}

in Storybook the props of the Component are rendered like this:

{
  className: '',
  src: '',
  index: '',
  title: '',
  subline: '',
  details: {},
  defaultOpen: "false",
  defaultActive: "false",
  defaultMuted: "false",
}

So all boolean props are rendered as string and are checked in the knobs panel when the prop is false. When i change the checkbox the prop is a boolean as it has to be.

zurmoehle avatar Jun 23 '21 12:06 zurmoehle