This might look long, but it’s only because I want to make sure to provide all the info that I have. So I have a Formik form in a react component which handles a couple of text inputs and a few file uploads. I am using this Formik component within a React class component: This is the file upload input
Tag: yup
How can I make a yup number accept nullable values?
I have the following yup check: And right now if I leave the field blank, it validates as false. Is there any way to make yup.number() accept empty values? I have tried: But it doesn’t seem to work. Any ideas on how I can make such thing happen? Answer You have to pass true to nullable – nrOfApples: yup.number().min(0).max(999).nullable(true); From:
Formik, Yup Password Strength Validation with React
I am fairly new to React, and i have a sign up page where i have a password field to be validated with a Regex. I am using Formik and Yup for validations, but i have encountered an error where it says the property where the length function is being called is undefined when i type in the “password” field.