Skip to content

Commit

Permalink
Merge pull request #3871 from SophanySC/fix/ISSUE-3846-setValue-docs
Browse files Browse the repository at this point in the history
fix-docs: return type of setValue in docs did not match the function typing
  • Loading branch information
quantizor committed Sep 12, 2023
2 parents fe4ed7e + 405578c commit ce305f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api/formik.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Set `touched` imperatively. Calling this will trigger validation to run if `vali

If `validateOnBlur` is set to `true` and there are errors, they will be resolved in the returned `Promise`.

#### `setValues: (fields: React.SetStateAction<{ [field: string]: any }>, shouldValidate?: boolean) => void`
#### `setValues: (fields: React.SetStateAction<{ [field: string]: any }>, shouldValidate?: boolean) => Promise<void | FormikErrors<Values>>`

Set `values` imperatively. Calling this will trigger validation to run if `validateOnChange` is set to `true` (which it is by default). You can also explicitly prevent/skip validation by passing a second argument as `false`.

Expand Down

0 comments on commit ce305f5

Please sign in to comment.