8000 PropTypes generated by Object.keys are wrapped with double quotes · Issue #132 · blueberryapps/react-bluekit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
PropTypes generated by Object.keys are wrapped with double quotes #132
Open
@JamesPlayer

Description

@JamesPlayer

If I have a component that has a PropType of oneOf, the array is generated using Object.keys ie:

const icons = {
  trash: '...',
  tag: '...',
  tagMerge: '...',
  ...
};

Icon.propTypes = {
  icon: PropTypes.oneOf(Object.keys(icons)),
  ...
};

In BlueKit each icon in the enum dropdown is wrapped with double quotes, which stops the preview from working:

screen capture on 2017-12-20 at 10-14-52

I can see in the componentsIndex.js that it's been generated with the quotes:

propsDefinition: {icon:{type:{name:"enum",value:[{value:"\"trash\"",computed:false},{value:"\"tag\"",computed:false},{value:"\"tagMerge\"",computed:false} ...

Please look into it, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0