Skip to content

Generates invalid value for PropType.oneOf (array of strings) #26

@WizardCM

Description

@WizardCM

Warning displayed in Jest from React:

 Warning: Failed prop type: Invalid prop `action` of value `'add'` supplied to `YourComponent`, expected one of ["add","edit"]

It seems it generated a string with quotes included within?

JS file summary:

import PropTypes from 'prop-types';

YourComponent.propTypes = {
    action: PropTypes.oneOf(['add', 'edit'])
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions