From 654b6d118b490378c49bbbe1dea3173e8360c233 Mon Sep 17 00:00:00 2001 From: dfedoryshchev Date: Mon, 25 May 2026 18:40:15 +0100 Subject: [PATCH] docs: correct setValues callback return type to TFieldValues --- src/content/docs/useform/setvalues.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/content/docs/useform/setvalues.mdx b/src/content/docs/useform/setvalues.mdx index 2fbb2ed9d..1a4aca5d0 100644 --- a/src/content/docs/useform/setvalues.mdx +++ b/src/content/docs/useform/setvalues.mdx @@ -5,7 +5,7 @@ metaDescription: Update multiple React Hook Form field values at once using an o sidebar: apiLinks --- -## \ `setValues:` (value: Partial\ | ((data: TFieldValues) => Partial\), options?: SetValueConfig) => void +## \ `setValues:` (value: Partial\ | ((formValues: TFieldValues) => TFieldValues), options?: SetValueConfig) => void This function allows you to dynamically set multiple field values at once and have the options to validate and update the form state. It also accepts a callback function that receives the current form values, making it easy to derive the next state from the existing one. @@ -13,16 +13,16 @@ This function allows you to dynamically set multiple field values at once and ha --- -| Name | | Description | -| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `value`
Partial\ \| (data: TFieldValues) => Partial\ | | An object containing the field values to update, or a callback function that receives the current form values and returns the updated values. This argument is required. | -| `options` | `shouldValidate`
boolean | | -| | `shouldDirty`
boolean | | -| | `shouldTouch`
boolean | Whether to set the updated inputs to be touched. | +| Name | | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `value`
Partial\ \| (formValues: TFieldValues) => TFieldValues | | An object containing the field values to update, or a callback function that receives the current form values and returns the next form values. This argument is required. | +| `options` | `shouldValidate`
boolean | | +| | `shouldDirty`
boolean | | +| | `shouldTouch`
boolean | Whether to set the updated inputs to be touched. | -- When using the callback form, the function receives a snapshot of the current form values and should return only the fields you want to update. +- When using the callback form, the function receives a snapshot of the current form values and should return the next form values. - This method does not reset the form. Use [`reset`](/docs/useform/reset) if you need to reinitialize `defaultValues`.