Skip to content

Commit 4c50a5b

Browse files
docs: correct setError error argument type signature (#1205)
* docs: correct setError error argument type signature * chore: prettier format seterror.mdx table alignment
1 parent b3ff88d commit 4c50a5b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/content/docs/useform/seterror.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ description: Manually set an input error
44
sidebar: apiLinks
55
---
66

7-
## \</> `setError:` <TypeText>`(name: string, error: FieldError, { shouldFocus?: boolean }) => void`</TypeText>
7+
## \</> `setError:` <TypeText>`(name: string, error: ErrorOption, { shouldFocus?: boolean }) => void`</TypeText>
88

99
The function allows you to manually set one or more errors.
1010

1111
### Props
1212

1313
---
1414

15-
| Name | Type | Description |
16-
| ------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
17-
| `name` | <TypeText>string</TypeText> | input's name. |
18-
| `error` | <TypeText>`{ type: string, message?: string, types: MultipleFieldErrors }`</TypeText> | Set an error with its type and message. |
19-
| config | <TypeText>`{ shouldFocus?: boolean }`</TypeText> | Should focus the input during setting an error. This only works when the input's reference is registered, it will not work for custom register as well. |
15+
| Name | Type | Description |
16+
| ------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
17+
| `name` | <TypeText>string</TypeText> | input's name. |
18+
| `error` | <TypeText>`{ type?: string, message?: string, types?: MultipleFieldErrors }`</TypeText> | Set an error with its type and message. |
19+
| config | <TypeText>`{ shouldFocus?: boolean }`</TypeText> | Should focus the input during setting an error. This only works when the input's reference is registered, it will not work for custom register as well. |
2020

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

0 commit comments

Comments
 (0)