How to validate react form using switch? I have multiple input field (here I just added 2 fields) I am trying to validate form. How to validate it on submit using switch? I