Skip to content

Commit 68f4cf7

Browse files
committed
update doc on v7.49.0
1 parent c5455fc commit 68f4cf7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/content/docs/useform.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ sidebar: apiLinks
8585
| [reValidateMode](#reValidateMode) | Validation strategy **after** submitting behaviour. |
8686
| [defaultValues](#defaultValues) | Default values for the form. |
8787
| [values](#values) | Reactive values to update the form values. |
88+
| [errors](#errors) | Reactive errors to update the form errors. |
8889
| [resetOptions](#resetOptions) | Option to reset form state update while updating new form values. |
8990
| [criteriaMode](#criteriaMode) | Display all validation errors or one at a time. |
9091
| [shouldFocusError](#shouldFocusError) | Enable or disable built-in focus management. |
@@ -192,6 +193,22 @@ function App() {
192193
}
193194
```
194195

196+
#### errors: <TypeText>FieldErrors</TypeText> {#errors}
197+
198+
---
199+
200+
The `errors` props will react to changes and update the server errors state, which is useful when your form needs to be updated by external server returned errors.
201+
202+
```javascript copy
203+
function App() {
204+
const { errors, data } = useFetch("/api")
205+
206+
useForm({
207+
errors, // will get updated once errors returns
208+
})
209+
}
210+
```
211+
195212
#### resetOptions: <TypeText>KeepStateOptions</TypeText> {#resetOptions}
196213

197214
---

0 commit comments

Comments
 (0)