Closed
Description
What problem does this feature solve?
It would be very useful to explain component properties the following manner.
interface CommonProps {
size?: 'xl' | 'l' | 'm' | 's' | 'xs';
}
type ConditionalProps = {
color?: 'normal' | 'primary' | 'secondary';
appearance?: 'normal' | 'outline' | 'text';
} | {
color: 'white';
appearance: 'outline';
};
type Props = CommonProps & ConditionalProps
What does the proposed API look like?
This issue is related to #4294, but the use case is different.
Here is an article that goes into more information on this approach.