react-native-formik icon indicating copy to clipboard operation
react-native-formik copied to clipboard

Ability to perform field-level validations?

Open rk1 opened this issue 7 years ago • 5 comments

The <Field /> component from Formik allows for field-level validation and currently this is a bit of a pain to do with react-native-formik. Are there any plans to support it out of the box?

rk1 avatar Nov 15 '18 09:11 rk1

Hello, any news regarding this feature?
I am facing the same problem atm, @rk1 did you find a workaround?

florenzo-42 avatar Apr 15 '19 15:04 florenzo-42

I'm using Yup and it works great for validation, even on custom components.

pkreipke avatar Apr 29 '19 22:04 pkreipke

@florenzo-42 I'm settled for not using <Field /> at all, instead I'm using my own component and getting errors from the formik props manually.

rk1 avatar Apr 30 '19 07:04 rk1

Any news? I guess we just need to add the validade on the withFormikControl HOC

rafgoncalves avatar Apr 30 '19 12:04 rafgoncalves

I just used the validationSchema prop. Search on Formik git home page for "validationSchema". That's exactly what worked for me. No HOC needed for that.

pkreipke avatar Apr 30 '19 15:04 pkreipke