Skip to content

Commit 6bb7f52

Browse files
committed
docs: describe the parameters of onSubmit in more detail.
1 parent ac80a47 commit 6bb7f52

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/api/use-form.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,21 @@ This is your form submission handler, witch will pass your form's `values`. But
226226
function onSubmit (values: Values, helper: FormSubmitHelper): void | Promise<any>
227227
```
228228

229+
```ts
230+
interface FormSubmitHelper {
231+
setSubmitting: (isSubmitting: boolean) => void;
232+
}
233+
```
234+
235+
#### Parameters
236+
237+
- `values`: the validated `values`.
238+
- `helper`: some states or methods that can be helpful when submitting the form.
239+
240+
| Name | Description |
241+
|---------------|-------------------------------|
242+
|`setSubmitting`| Set isSubmitting imperatively.|
243+
229244
::: warning Important
230245
When the `onSubmit()` function is asynchronous, the `isSubmitting` variable is automatically reset to `false` upon completion. Conversely, if `onSubmit()` is synchronous, you must manually call `setSubmitting(false)` to reset `isSubmitting`.
231246
:::

0 commit comments

Comments
 (0)