'yup validate is either string or object

Depending on the case, my input will take either a string or an object. And I want to validate both of those cases. Below is my code but it is not working. Please help me!!

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source