oneOf is incorrectly giving a false when using refs
password: yup.string().required('Password is required'),
confirmPassword: yup.string().oneOf([yup.ref('password'), null], "Passwords don't match").required('Confirm Password is required'),
When the passwords match it is giving an error incorrectly
When the passwords match it shouldn't have any validation error
should be working in the latest version
import * as yup from 'yup'
yup
.object({
confirmPassword: yup
.string()
.oneOf([yup.ref('password'), null], "Passwords don't match")
.required('confirm password is required'),
password: yup.string().required(),
})
.isValid({
confirmPassword: 'foobar',
password: 'foobar',
})
.then(valid => console.log(valid))
Above code leads to exception , with yup version 0.24.0
Uncaught TypeError: Cannot read property 'set' of undefined
at addToList (mixed.js:88)
Most helpful comment
should be working in the latest version