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
mutuallyExclusiveProps() only checks that at least one exclusive prop is provided. Otherwise it throws with at least one prop that is mutually exclusive with this propType is required. However, two exclusive props are required for mutuallyExclusiveProps() to do anything, since the current propName is not considered an exclusive prop.
The behavior of mutuallyExclusiveProps().isRequired is unclear. The only requirement is that
it('fails when required, and one of the exclusive props is null/undefined')
and this doesn't describe the current behavior of .isRequired. Currently, if the current propName is not listed as an exclusive prop, then mutuallyExclusiveProps() behaves the exact same as mutuallyExclusiveProps().isRequired. If the current propName is included as an exclusive prop, then the only difference is that propName={null/undefined} is additionally considered as a set prop.
This seems strange because of the following scenario:
mutuallyExclusiveProps()
only checks that at least one exclusive prop is provided. Otherwise it throws withat least one prop that is mutually exclusive with this propType is required
. However, two exclusive props are required formutuallyExclusiveProps()
to do anything, since the currentpropName
is not considered an exclusive prop.The behavior of
mutuallyExclusiveProps().isRequired
is unclear. The only requirement is thatand this doesn't describe the current behavior of
.isRequired
. Currently, if the currentpropName
is not listed as an exclusive prop, thenmutuallyExclusiveProps()
behaves the exact same asmutuallyExclusiveProps().isRequired
. If the currentpropName
is included as an exclusive prop, then the only difference is thatpropName={null/undefined}
is additionally considered as a set prop.This seems strange because of the following scenario:
The text was updated successfully, but these errors were encountered: