If I have the following button with a defaultProp
export interface IButton {
variant: 'action' | 'secondary';
}
export const Button = styled('button')<IButton>`
background-color: #fff;
${props =>
props.variant === 'action' &&
css`
color: blue;
`};
${props =>
props.variant === 'secondary' &&
css`
color: gray;
`};
`;
Button.defaultProps = {
variant: 'action',
};
Is there a way to type it? When trying to use it like
<Button>Hello</Button>
Typescript complains about not passing variant, is there a way to type defaultProps with styled components?