Skip to content

Commit eba6ddf

Browse files
committed
update setErrors
1 parent 6e7a2e9 commit eba6ddf

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/content/docs/useform/seterror.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@ The function allows you to manually set one or more errors.
3636
setError("root.serverError", {
3737
type: "400",
3838
})
39-
setError("root.random", {
40-
type: "random",
41-
})
4239
```
43-
- Can be useful in the `handleSubmit` method when you want to give error feedback to a user after async validation. (ex: API returns validation errors)
4440
- `shouldFocus` doesn't work when an input has been disabled.
45-
- This method will force set `isValid` formState to `false`. However, it's important to be aware that `isValid` will always be derived from the validation result of your input registration rules or schema result.
46-
- There are certain keywords that need to be avoided to prevent conflicts with type checking. They are `type` and `types`.
41+
- This method will force <code>formState.isValid</code> to <code>false</code>.
42+
However, <code>isValid</code> is always derived from the validation results of your
43+
registered inputs or schema.
44+
- There are certain keywords that need to be avoided to prevent conflicts with type checking.
4745

4846
</Admonition>
4947

0 commit comments

Comments
 (0)