I have this kind of interface
export interface IButton {
label: string;
withIcon?: boolean;
underlined?: boolean;
selected?: boolean;
iconName?: string;
isLink?: boolean;
href?: string;
onCLick?: () => void;
}
Is it possible to make conditionally the use of iconName based on the use of withIcon ?
To make an example:
<Button label='test' />
---> this should not throw error
<Button withIcon />
this should throw an error that alert me that iconName is missing.