bamlab / react-native-formik

Set of helpers to make form awesome with React Native and Formik
MIT License
398 stars 50 forks source link

Ability to perform field-level validations? #39

Open rk1 opened 5 years ago

rk1 commented 5 years ago

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?

florenzo-42 commented 5 years ago

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

pkreipke commented 5 years ago

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

rk1 commented 5 years ago

@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.

rafgoncalves commented 5 years ago

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

pkreipke commented 5 years ago

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.