-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
values.hasOwnProperty is not a function in v2 #2138
Comments
Can you create a sandbox to reproduce? |
I'm experiencing this too. Looks like a simple one line fix in Change L1074 if (values.hasOwnProperty(k)) { To if (Object.prototype.hasOwnProperty.call(values, k)) { |
Feel free to submit PR. Be sure to reference that urql issue too |
jaredpalmer
pushed a commit
that referenced
this issue
Jan 7, 2020
Closes #2138 From time to time, Formik may be passed Object-like data that does not inherit from the Object prototype. In these cases, hasOwnProperty is not defined, and prepareDataForValidation will throw. The fix is to use Object.prototype to call hasOwnProperty on the data. See urql-graphql/urql#343
@emrosenf wow, same PR, same moment 🙌 |
Good timing @BjoernRave! Thanks for your hard work @jaredpalmer, Formik is a super useful library! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When submitting my form before it runs any validation it throws the following error:
I created a wrapper with formik and this wrapper is not throwing this error on some forms, but on some it is. Not really sure why.
It works with formik 1.5.8
If you need more info, I am happy to provide. I thought this might be enough, otherwise I can add you as collaborator to my project
The text was updated successfully, but these errors were encountered: