Skip to content

Commit

Permalink
fix: value is same as message in setFieldError (#3203)
Browse files Browse the repository at this point in the history
setError is setFieldError bound to specific field. Therefore the setError value should have same type as setFieldError message
  • Loading branch information
hixus authored May 21, 2021
1 parent 261ee30 commit 3a9c707
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/stupid-boxes-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'formik': patch
---

Fixes type of setError value as it is same as setFieldError message
2 changes: 1 addition & 1 deletion packages/formik/src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export interface FieldHelperProps<Value> {
/** Set the field's touched value */
setTouched: (value: boolean, shouldValidate?: boolean) => void;
/** Set the field's error value */
setError: (value: Value) => void;
setError: (value: string | undefined) => void;
}

/** Field input value, name, and event handlers */
Expand Down

1 comment on commit 3a9c707

@vercel
Copy link

@vercel vercel bot commented on 3a9c707 May 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

formik – ./website

formik-formium.vercel.app
formik-git-master-formium.vercel.app
formik.org

Please sign in to comment.