Skip to content

Enum strings in propTypes are wrapped in a tick #57

Open
@nikgraf

Description

@nikgraf

I defined a propType like this:

type: PropTypes.oneOf(['cute', 'aggressive', 'shy']),

This resulted in:

{
  computed: false,
  value: "'shy'",
}

screen shot 2016-02-16 at 14 17 35

You can see the shy is wrapped in a single tick and in double quotes. Kind of a string in a string ;)]

Is this a feature or bug? I'm happy to submit a PR in case this is a bug.

Additional info: when I use numbers they are also presented as a String:

noseLength: PropTypes.oneOf([33, 42, 88]),

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions