IWarningOptions interface
Properties
conditionally |
Warns when props are required if a condition is met |
controlled |
Check for and warn on the following error conditions with a form component: - A value prop is provided (indicated it's being used as controlled) without a change handler, and the component is not read-only - Both the value and defaultValue props are provided - The component is attempting to switch between controlled and uncontrolled The messages mimic the warnings React gives for these error conditions on input elements. The warning will only be displayed once per component instance. |
deprecations | Warns when deprecated props are being used. Each key is a prop name and each value is either undefined or a replacement prop name. |
mutually |
Warns when two props which are mutually exclusive are both being used. The key is one prop name and the value is the other. |
name | Name of the component |
other | Generic messages |
props | Current component props |
Property Details
conditionallyRequired
Warns when props are required if a condition is met
conditionallyRequired?: {
requiredProps: string[];
conditionalPropName: string;
condition: boolean;
}[];
Property Value
{ requiredProps: string[]; conditionalPropName: string; condition: boolean; }[]
controlledUsage
Check for and warn on the following error conditions with a form component: - A value prop is provided (indicated it's being used as controlled) without a change handler, and the component is not read-only - Both the value and defaultValue props are provided - The component is attempting to switch between controlled and uncontrolled
The messages mimic the warnings React gives for these error conditions on input elements. The warning will only be displayed once per component instance.
controlledUsage?: Pick<IWarnControlledUsageParams<P>, 'valueProp' | 'defaultValueProp' | 'onChangeProp' | 'readOnlyProp'>;
Property Value
Pick<IWarnControlledUsageParams<P>, 'valueProp' | 'defaultValueProp' | 'onChangeProp' | 'readOnlyProp'>
deprecations
Warns when deprecated props are being used. Each key is a prop name and each value is either undefined or a replacement prop name.
deprecations?: ISettingsMap<P>;
Property Value
ISettingsMap<P>
mutuallyExclusive
Warns when two props which are mutually exclusive are both being used. The key is one prop name and the value is the other.
mutuallyExclusive?: ISettingsMap<P>;
Property Value
ISettingsMap<P>
name
Name of the component
name: string;
Property Value
string
other
Generic messages
other?: string[];
Property Value
string[]
props
Current component props
props: P;
Property Value
P