Below is my React form validation code in which I am using formik. By default when the form loads, I want to keep the submit button disabled:
React
formik
To have the button initially disabled just check if the touch object is empty and keep it this way until all the fields are validated with !isValid
!isValid
disabled={!isValid || (Object.keys(touched).length === 0 && touched.constructor === Object)}