I would like a custom button to optionally receive type attribute:
export interface ButtonProps {
children: React.ReactNode;
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
type: ??
}
export const Button: React.FunctionComponent<ButtonProps> = ({ children, ...buttonProps }) => {
return <StyledButton {...buttonProps}>{children}</StyledButton>;
};
export default Button;
Same as with 'onClick' which is working. Any type I'm trying to fill in, it still throws an error. What is the correct type for the type attribute?