@types/yup package and had problems.The latest version (0.26.19) made my CD pipeline crash with the following error :
TS2322: Type 'Ref' is not assignable to type 'string'.
I'm guessing it comes from the latest version because the previous one was released 5 days ago and I did several pipelines since then that went fine
Here is the the line in my code that triggers this:
confirmPassword: yup.string().oneOf([yup.ref("password"), null], passwordMismatch[lang])
I think this error shouldn't be thrown, as the Yup docs mention that .ref is expecting a string parameter
@guillaumepn
Yes, agreed that should work.
With one little addition given that you are using null in oneOf() as well. So I changed the definition to include nullable() like this:
confirmPassword: yup.string().nullable().oneOf([yup.ref("password"), null]),
Thanks!
Most helpful comment
@guillaumepn
Yes, agreed that should work.
With one little addition given that you are using
nullinoneOf()as well. So I changed the definition to includenullable()like this: