Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/content/reset-field.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ After invoke this function.

`ResetField` has the ability to retain field state. Here are the options you may want to use:

| Name | | Type | Description |
| ------- | -------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | | <TypeText>string</TypeText> | registered field name. |
| options | `keepError` | <TypeText>boolean</TypeText> | When set to `true`, field error will be retained. |
| | `keepDirty` | <TypeText>boolean</TypeText> | When set to `true`, `dirtyFields` will be retained. |
| | `keepTouched` | <TypeText>boolean</TypeText> | When set to `true`, `touchedFields` state will be unchanged. |
| | `defaultValue` | <TypeText>unknown</TypeText> | When this value is **not** provided, field will be revert back to it's defaultValue.<br/>When this value is provided:<br/><ul><li>field will be updated with the supplied value</li> <li>field's `defaultValue` will be updated to this value.</li> </ul> |
| Name | | Type | Description |
| ------- | -------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | | <TypeText>string</TypeText> | registered field name. |
| options | `keepError` | <TypeText>boolean</TypeText> | When set to `true`, field error will be retained. |
| | `keepDirty` | <TypeText>boolean</TypeText> | When set to `true`, `dirtyFields` will be retained. |
| | `keepTouched` | <TypeText>boolean</TypeText> | When set to `true`, `touchedFields` state will be unchanged. |
| | `defaultValue` | <TypeText>unknown</TypeText> | When this value is **not** provided, field will be revert back to it's defaultValue.<br/>When this value is provided:<br/><ul><li>field will be updated with the supplied value</li> <li>field's `defaultValue` will be updated to this value.</li> <li>Only support non <code>undefined</code> value.</li> </ul> |

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

Expand Down
3 changes: 3 additions & 0 deletions src/data/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,9 @@ setValue('test', '')
object.
</p>
</li>
<li>
<p>Do not support custom object, Class or File object.</p>
</li>
</ul>
</>
),
Expand Down