disallowedIf: wraps a proptype and accepts another prop name and another prop type. If the other prop is provided and matches the given type, the validator fails. Functionally similar to mutuallyExclusiveProps and mutallyExclusivePropTypes but is more flexible in the type being compared (although less flexible in the number of props that can be compared).
disallowedIf
: wraps a proptype and accepts another prop name and another prop type. If the other prop is provided and matches the given type, the validator fails. Functionally similar tomutuallyExclusiveProps
andmutallyExclusivePropTypes
but is more flexible in the type being compared (although less flexible in the number of props that can be compared).Example usage
Pass
Fail