Closed stefcameron closed 4 years ago
It surely should be chainable, and as you can see, it is. Are you certain you haven't mocked out prop-types
somehow?
@ljharb Thank you for quick the reality check! Terribly sorry. I had a prop type defined in one file and referenced in another where the other file was adding .isRequired
to the definition, so when I added .isRequired
to the source, that resulted in undefined
in the other file. 🤦♂
It appears that there's a chaining issue with
PropTypes.oneOf([...]).isRequired
, which results inundefined
, even thoughisRequired
should be chainable with that type, based on my (very limited) understanding of the code here: https://github.com/facebook/prop-types/blob/master/factoryWithTypeCheckers.js#L341When I define
I get this error in the browser console:
I'm seeing this in prop-types@15.7.2
Is
isRequired
really not chainable in this case?