interface CircleButtonBaseProps {
title?: string;
}
interface CircleButtonWithIcon extends CircleButtonBaseProps {
IconComponent?: never;
Icon: React.ReactNode;
}
interface CircleButtonWithIconComponent extends CircleButtonBaseProps {
IconComponent: React.ElementType;
Icon?: never;
}
type CircleButtonProps = CircleButtonWithIcon | CircleButtonWithIconComponent;
The expectation is that if I create a <CircleButton ..> with both Icon and IconComponent I should get an error or warning, but I get neither. I'm not sure how to fix it or if what I'm trying to do is possible. CircleButton 's props should accept either an Icon or IconComponent, but not both