Closed qfox closed 5 years ago
What error do you get with PropTypes.oneOfType([PropTypes.oneOf(['normal', 'pseudo']), PropTypes.oneOf(['my-custom'])])
?
In general, the oneOf
validator function is opaque; i can't reliably know what values it had (altho it might set .typeChecker
)
What error do you get with
This one:
Warning: Failed theme type: Invalid theme `theme` supplied to `Button`.
Feels like this problem on the other side?
In general, the oneOf validator function is opaque; i can't reliably know what values it had (altho it might set .typeChecker)
Well, yes, but I though if we run each validator and catch every message anyway we should have a way to combine something from the result.
Much harder to do this with and
operator, but guess it's fine for and
to have just one (the first) fail message from it.
In other words, it seems like PropTypes.oneOfType
lacks this feature - I'm not sure the complexity is worth it, there or in or
.
When I call this
... and I see this: (actual):
But want to see this (expected):
Or even (ideal):
Versions: