diff --git a/README.md b/README.md index 78f324f..ad0ea30 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,8 @@ function App() { ``` The `SubmitButton` and `ResetButton` will disable automatically depending on form state. The `ResetButton` is enabled if the form is dirty. The `SubmitButton` is enabled if the form is valid or if it is not dirty. +If you do want to control the disable behavior yourself you can provide the (usual ant design) `disable: boolean` prop. +I.e. `` will make the button always be enabled. ## Form- and Field-level Validation diff --git a/src/submit-button/index.tsx b/src/submit-button/index.tsx index 12c22cd..262af27 100644 --- a/src/submit-button/index.tsx +++ b/src/submit-button/index.tsx @@ -5,12 +5,12 @@ import { ButtonProps } from 'antd/lib/button' export const SubmitButton = ({ children, ...restProps }: ButtonProps) => ( - {({ form: { isSubmitting, isValid, dirty } }: FieldProps) => ( + {({ form: { isSubmitting, isValid, dirty, submitCount } }: FieldProps) => (