diff --git a/components/button/__tests__/__snapshots__/index.test.tsx.snap b/components/button/__tests__/__snapshots__/index.test.tsx.snap index 21fab06..3c5757d 100644 --- a/components/button/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/button/__tests__/__snapshots__/index.test.tsx.snap @@ -7,6 +7,7 @@ exports[`Button should render empty button correctly 1`] = ` disabled={false} effect={true} ghost={false} + htmlType="button" loading={false} shadow={false} size="medium" @@ -23,6 +24,7 @@ exports[`Button should render special styles 2`] = ` disabled={false} effect={true} ghost={false} + htmlType="button" loading={true} shadow={false} size="medium" diff --git a/components/button/button.tsx b/components/button/button.tsx index 9f2f0b9..d3ef68d 100644 --- a/components/button/button.tsx +++ b/components/button/button.tsx @@ -17,6 +17,7 @@ interface Props { auto?: boolean effect?: boolean disabled?: boolean + htmlType?: React.ButtonHTMLAttributes['type'] icon?: React.ReactNode iconRight?: React.ReactNode onClick?: React.MouseEventHandler @@ -26,6 +27,7 @@ interface Props { const defaultProps = { type: 'default' as ButtonTypes, size: 'medium' as NormalSizes, + htmlType: 'button' as React.ButtonHTMLAttributes['type'], ghost: false, loading: false, shadow: false, @@ -57,6 +59,7 @@ const Button: React.FC> = ({ ...btnProps }) auto, size, icon, + htmlType, iconRight, className, ...props @@ -115,7 +118,7 @@ const Button: React.FC> = ({ ...btnProps }) return (