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

boolean knobs renders as string in Storybook #96

Description

@zurmoehle

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions