react-fake-props icon indicating copy to clipboard operation
react-fake-props copied to clipboard

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

Open WizardCM opened this issue 3 years ago • 0 comments

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'])
};

WizardCM avatar May 17 '22 05:05 WizardCM