diff --git a/src/content/docs/useform/reset.mdx b/src/content/docs/useform/reset.mdx index d05813620..90e0c74b7 100644 --- a/src/content/docs/useform/reset.mdx +++ b/src/content/docs/useform/reset.mdx @@ -14,18 +14,18 @@ Reset the entire form state, fields reference, and subscriptions. There are opti `Reset` has the ability to retain formState. Here are the options you may use: -| Name | Type | Description | -| ------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `values` | object | An optional object to reset form values, and it's recommended to provide the **entire** defaultValues when supplied. | -| `keepErrors` | boolean | All errors will remain. This will not guarantee with further user actions. | -| `keepDirty` | boolean | `DirtyFields` form state will remain, and `isDirty` will temporarily remain as the current state until further user's action.

**Important:** this keep option doesn't reflect form input values but only dirty fields form state. | -| `keepDirtyValues` | boolean | `DirtyFields` and `isDirty` will remained, and only none dirty fields will be updated to the latest rest value. [Check out the example.](https://codesandbox.io/s/react-keepdirtyvalues-o8to91)

**Important:** formState `dirtyFields` will need to be subscribed. | -| `keepValues` | boolean | Form input values will be unchanged. | -| `keepDefaultValues` | boolean | Keep the same defaultValues which are initialised via `useForm`. | -| `keepIsSubmitted` | boolean | `isSubmitted` state will be unchanged. | -| `keepTouched` | boolean | `isTouched` state will be unchanged. | -| `keepIsValid` | boolean | `isValid` will temporarily persist as the current state until additional user actions. | -| `keepSubmitCount` | boolean | `submitCount` state will be unchanged. | +| Name | | Type | Description | +| --------- | ------------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `values` | | object \| (values: Object) => Object | An optional object to reset form values, and it's recommended to provide the **entire** defaultValues when supplied. | +| `options` | `keepErrors` | boolean | All errors will remain. This will not guarantee with further user actions. | +| | `keepDirty` | boolean | `DirtyFields` form state will remain, and `isDirty` will temporarily remain as the current state until further user's action.

**Important:** this keep option doesn't reflect form input values but only dirty fields form state. | +| | `keepDirtyValues` | boolean | `DirtyFields` and `isDirty` will remained, and only none dirty fields will be updated to the latest rest value. [Check out the example.](https://codesandbox.io/s/react-keepdirtyvalues-o8to91)

**Important:** formState `dirtyFields` will need to be subscribed. | +| | `keepValues` | boolean | Form input values will be unchanged. | +| | `keepDefaultValues` | boolean | Keep the same defaultValues which are initialised via `useForm`. | +| | `keepIsSubmitted` | boolean | `isSubmitted` state will be unchanged. | +| | `keepTouched` | boolean | `isTouched` state will be unchanged. | +| | `keepIsValid` | boolean | `isValid` will temporarily persist as the current state until additional user actions. | +| | `keepSubmitCount` | boolean | `submitCount` state will be unchanged. |