Need to set up yup validation which is not required and works on only one condition

I added yup validation in the date picker so what is happening now if I click on submit it says field required Invalid Date! but my task needs to set validation such like the error will generate only if the date is greater than today’s date that I have added in max and also it is not added in any .required(“Required!”) thing but not sure why it’s working as Required! field which I don’t need to set as Required!

How to restrict formik validation when you click cancel button in react

from the field if you defocus without giving anything you are getting the validation error as well without giving value if you click on submit button you are getting validation error this is right ,but how to restrict the cancel button that without giving any data in the field if you click the cancel button then the validation error should not come ,how to restrict the formik validation only for cancel button or any kind of link.
can I use validateOnBlur particularly for cancel button, because in initial stage if i use that its disabling for all defocus kind of error, but I need only clicking on cancel that validation errors should not come. what approach should I follow.