I am using validation for postalcode in a input box.
phone: yup
.number()
.max(9)
.typeError("Provide in postalcode number format"),
When typeError() is given to phone(which is not specified required), and when nothing is entered for phone, then also it attaches a typeError to it. Ideally if nothing is entered and it is not specified "required", it should not give an error.
I am using validation for postalcode in a input box.
phone: yup .number() .max(9) .typeError("Provide in postalcode number format"),
When typeError() is given to phone(which is not specified required), and when nothing is entered for phone, then also it attaches a typeError to it. Ideally if nothing is entered and it is not specified "required", it should not give an error.