Customize yup number

69

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')
});

Comments

Submit
0 Comments