Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

boolean knobs renders as string in Storybook #96

Open
zurmoehle opened this issue Jun 23, 2021 · 0 comments
Open

boolean knobs renders as string in Storybook #96

zurmoehle opened this issue Jun 23, 2021 · 0 comments
Labels

Comments

@zurmoehle
Copy link

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 zurmoehle added the bug label Jun 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

1 participant