Trying to get Formik props from validate function #3835
Unanswered
ismajl-ramadani
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I'm trying to access formik.getFieldMeta method from validate function, but I'm not being able to do it. I want to achieve a custom validation for some specific case, and I was referring to this question in StackOverflow. The validate looks like is providing only values and the props that are passed from the outside wrapper of withFormik component, but not the Formik exposed props.
To give you a clear example,
And then I have a parent component that renders the form and handles the submit:
And I also have a parent component for the AccountSettingsWithFormik component:
Now in the validate function I only get the props passed from the
Account, and not the props that I'm assuming should be injected from the
withFormik
I'm not sure if I'm doing something wrong or if this is a bug in the
library. I'm using version of Formik (2.2.9) and React
(18.2.0)
Beta Was this translation helpful? Give feedback.
All reactions