I have this button component:
export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
small?: boolean;
}
class Button extends React.Component<ButtonProps> { ... }
But when I try to do:
<Button type="submit"></Button>
I get this error:
Property 'type' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<{ children?: ReactNode; }>'
Why? Isn't the type
attribute part of React.HTMLAttributes<HTMLButtonElement>
? What is the proper/recommended way to set this attribute?