You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running into an issue where oneOfType() is passed in types of shape and string but is only allowing string seemingly.
Reproduced here (using a simplified version of types I have encountered on a project I am working on), https://jsfiddle.net/liamness/1du5jvwt/, with the warning:
Failed prop type: Invalid prop `schema[1]` supplied to `ComponentName`, expected one of type [string].
The text was updated successfully, but these errors were encountered:
The real issue is being masked here; it's that name: PropTypes.string.required, is invalid. It's .isRequired, not .required.
When I fix that, I correctly see no error.
I see the proper error message when I use just the shape - iow, oneOfType seems to be suppressing the actually helpful error message from shape, so that seems like a bug worth fixing.
I am running into an issue where
oneOfType()
is passed in types ofshape
andstring
but is only allowingstring
seemingly.Reproduced here (using a simplified version of types I have encountered on a project I am working on), https://jsfiddle.net/liamness/1du5jvwt/, with the warning:
Failed prop type: Invalid prop `schema[1]` supplied to `ComponentName`, expected one of type [string].
The text was updated successfully, but these errors were encountered: