Most voted "yup" questions
10 questions
Sort by count of
-
4
votes1
answer63
viewsYup Mixed does not work notRequired or nullable
Good afternoon, I am validating the data of a form with Yup and need that only images can be loaded, so I used the following code: // formato que pode ser upado no input de email const…
-
2
votes0
answers298
viewsValidating a nested and conditionally optional Yup scheme
I am facing a problem when trying to validate a scheme nested with Yup (). My scenario is that I have the following payload (which may not always contain maxAge and maxAge, but at least one of…
-
2
votes1
answer1301
viewsValidating password confirmation in Yup with React
I have to validate a form where the user can update his password, I’m using Yup to do this. My code is like this: const schema = Yup.object().shape({ name: Yup.string().notRequired().min(3, "O nome…
-
1
votes1
answer241
viewsYup: How to make a conditional rule?
I’m trying to make a conditional rule with Yup, but following the steps of the documentation, I get this mistake: Typeerror: ref must be a string, got: true if (typeof key !== 'string') throw new…
-
1
votes1
answer188
viewsHow to compare 2 values with YUP
Good morning I have a validation to do with Yup, and I need to make sure the initial interval is not longer than the final interval, anyone have any idea how to do that? I tried to pass the same…
-
0
votes0
answers63
viewsButton does not call onsubmit in formik - React Native
all good? I have a Validator with Yup, and a formik, but somehow onsubmit is not called, when I click the button, I already checked in the Debugger if something is called and nothing :( This is my…
-
0
votes2
answers227
viewsHow to validate the date of birth by Yup
Knowing that the date cannot be longer than the present date. userValidation.js: export const UserSchema = Yup.object({ date: Yup.date().required("Campo obrigatório") }); html: <Field…
-
0
votes0
answers34
viewsError validation with Yup
Good evening. I’m trying to perform an error validation with Yup on an API. However I cannot show the error to the end user, as VS Code informs me that the path is Undefined. Follows the code.…
-
-1
votes1
answer166
viewsHow to change the value of an object within the array with Formik and Yup?
Here I create the initial values of Shape: const defaultFormShape = { name: '', email: '', group: { id: '' }, addresses: [{ name: '' ]} }; And here I validate Schema: const validationSchema =…
-
-1
votes1
answer690
viewsAttempted import error: 'Yup' does not contain a default export (Imported as 'Yup'). NPM
I am creating a site with authentication service and in it I intend to use Yup, an NPM module. I installed everything right but when I start the application it appears: Attempted import error: 'yup'…