Skip to content

Commit 6e7a2e9

Browse files
committed
update handleSubmit
1 parent 38e752c commit 6e7a2e9

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/content/docs/useform/handlesubmit.mdx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@ This function will receive the form data if form validation is successful.
1919

2020
<Admonition type="important" title="Rules">
2121

22-
- You can easily submit form asynchronously with handleSubmit.
23-
24-
```javascript copy
25-
handleSubmit(onSubmit)()
26-
27-
// You can pass an async function for asynchronous validation.
28-
handleSubmit(async (data) => await fetchAPI(data))
29-
```
30-
3122
- `disabled` inputs will appear as `undefined` values in form values. If you want to prevent users from updating an input and wish to retain the form value, you can use `readOnly` or disable the entire &lt;fieldset /&gt;. Here is an [example](https://codesandbox.io/s/react-hook-form-disabled-inputs-oihxx).
3223
- `handleSubmit` function will not swallow errors that occurred inside your onSubmit callback, so we recommend you to try and catch inside async request and handle those errors gracefully for your customers.
3324

0 commit comments

Comments
 (0)