Category "yup"

Formik - setting dynamic values for select box

I have a address form containing country and state field when user selects country i want to fetch state list form backend and update state select box value lis

How disable validation Formik when clicking cancel button?

I'm using Material-ui with Formik and Yup for form validation, but I'm having trouble disabling form validation when clicking the cancel button. Tried using for

Yup validation check if not empty

const validationSchema = Yup.object().shape({ newPassword: Yup.string().min(8, 'Password must be at least 8 characters'); }); I want to validation check on

Formik onChange is not working for dropdown using react-select

Below is the code where I am trying to select value from dropdown. handleChange is not working, when I select the value from dropdown it's not getting updated w

VeeValidate and YUP async lazy email validation sending requests for every input in form on background

I'm trying to add lazy e-mail unique validator to my registration form. It works but when i type something in other fields (including e-mail field also) unique

Validating array of different object shapes in yup

I am using formik for form validation and came across some problems in array validation. here is my form structure { flow: [ { text: "hello" }, { input:

Yup when condition inside nested object

so i have a problem with conditional validation using yup. Basically i want shipping to have required properties when the checkbox is not toggled. I am using yu

(Yup) how to create multiple errors using a single .test() function

EDIT: while the accepted solution worked, this worked much better in my use case I have one function that validates that neither input field A nor input field B

onChange on TextInput Not Working Inside Formik

Generally <TextInput> allows you to type even when you're just specifying a placeholder. However, when using within the Formik form, I am unable to type a

How do I not allow special characters and space in react hook using yup

Here's the code: { label: "Name", name: "name", placeholder: 'Name', type: "text", rule: yup.string() .required('Name is a r

How to use yup validation on dynamic form using react-hook-form with useFieldArray

I'm trying to create a dynamic form using react-hook-form's useFieldArray hook. The user should be able to add or remove fields, thus making it dynamic. I've lo

Yup / Formik async validation with debounce

How can debounce be applied to the async validation below (code from Yup's github) ? let asyncJimmySchema = string().test( 'is-jimmy', '${path} is not Jimm

Validating file size and format with YUP

I have a form using reactjs + formik + yup. I have a multi file upload field. I want to validate the file format and max size using yup. How can I do this?

Yup returns always an error even if all fields are valid

Yup is returning always one error in the array even though all fields are valid. The validation is working fine, is checking each field and showing the errors c

Validating file presence with YUP

I'm using Yup to validate my form. In one of my form, I want to validate that one <input type="file" /> has a file. I've tested this (and it's not workin

Yup / Formik validation using dynamic keys

I am trying to validate a form with a dynamic amount of fields - i.e., data is returned from an API that determines how many rows are shown, and for each row th