I am validating a field that can only take a positive decimal number. My Yup schema looks as follow:
yup.object().shape({
Duration: yup
.number()
.typeError('Please enter a duration. The field cannot be left blank.')
.positive('Must be a positive number.'),
})
As a result,
I could change the typeError() message for something more generic but I was wondering if there was a more comprehensive way to handle the scenario.
So, when the user enters