Closed
Description
Hi,
looks like whatever I try the button-has-type
rule can't understand the default prop.
type Props = {
type: 'submit' | 'button' | 'reset',
};
function Button({ type, ...extraProps }: Props) {
return <button type={type} {...extraProps} />;
}
Button.defaultProps = {
type: 'submit',
};
error "null" is an invalid value for button type attribute react/button-has-type
type Props = {
type: 'submit' | 'button' | 'reset',
};
function Button({ type = 'submit', ...extraProps }: Props) {
return <button type={type} {...extraProps} />;
}
error "null" is an invalid value for button type attribute react/button-has-type