How can I change Yup validation schema on form submit. I have yup schema where I am comparing date time. I set the date time value in yup. It should not be exceeded to the max
schema: object({
at: date()
.max(new Date()),
}),
The problem is maximum date is set at the time of first rendering.