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

boolean knobs renders as string in Storybook #96

@zurmoehle

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions