Answers for "yup number custom message"

1

yup number validation custom message

numberFiled: Yup.number()
                        .typeError('you must specify a number')
                        .min(0, 'Min value 0.')
                        .max(30, 'Max value 30.')
Posted by: Guest on April-22-2021
0

Customize yup number

const schema = yup.object().shape({
  name: yup.string()
    .required('name is required'),
  age: yup.number()
    .typeError('age must be a number')
    .positive('age must be greater than zero')
    .required('age is required')
});
Posted by: Guest on May-20-2021

Browse Popular Code Answers by Language