can "validate" and "validateSchema" be used concurrently?
See original GitHub issueBug, Feature, or Question?
Question
Current Behavior
Using the withFormik as a HOC, with both a validate function and a validateSchema function, seems to result in only validate being called on a handleSubmit, whereas onBlur events trigger validateSchema.
Desired Behavior
I’m not quite sure here. 😃 Should both validation types be called upon handleSubmit? I imagine if the answer is “yes”, either the results of the errors created by each one would have to be merged (could be messy), or the first one that produces errors stops the other function from being called.
Suggested Solutions
I had both validation types because I had not yet figured out how to handle a few use cases in yup. I think this is a good time to hunker down and figure that out so I only have validationSchema. 😃
If both validation types concurrently are not supported, it should be documented, or at least have the library throw an error if it sees both defined in the withFormik call.
Info
- Formik Version: 0.11.4
- OS: OS X Sierra
- Node Version: 8.9.4
- Package Manager and version: 5.6.0
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:13 (5 by maintainers)

Top Related StackOverflow Question
Yup is really nice (as is formik), but I have run into validation situations where it’d be nice to be able to use validateSchema as well as a custom validation function.
I would rather not have to call 2 functions. You can just run Yup validation schema.validate on your own within validate and keep a single source of truth in regards to validation. Imho much better