Skip to content

Commit

Permalink
Fix useFieldTouched selector
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredpalmer committed Nov 16, 2020
1 parent 76fa3c7 commit 4e515a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/honest-radios-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'formik': patch
---

Fix useFieldTouched selector
2 changes: 1 addition & 1 deletion packages/formik/src/useField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export function useFieldTouched<Values>(
name: string
): [boolean, (error: any) => void] {
const state = useFormikContextSelector<Values, boolean>(ctx =>
Boolean(getIn(ctx.errors, name))
Boolean(getIn(ctx.touched, name))
);

const set = useFormikContextSelector<
Expand Down

0 comments on commit 4e515a4

Please sign in to comment.