title: How to check if form is valid on submit in react formik
body: <p>I have used the formik library in my project. Also used yup library for form field validations. I want to check whether the form is valid or not before connecting to api on submit method. Below is my code used in my project.</p>
  
  <pre><code>&lt;Formik
                      isInitialValid = {false}
                      initialValues={this.formData}
                      validationSchema={CRYP_LOGIN_SCHEMA}
                      onSubmit={this.loginSubmit.bind(this)}&gt;
                      {({ errors, status, touched, isValid }) =&gt; (
                          &lt;Form  className="login_reg_form"&gt;
                              &lt;div className="input_control_wrp mb-4"&gt;
                                  &lt;div className="input_control"&gt;
                                      &lt;span className="left_icon"&gt;&lt;i className="fas fa-user"&gt;&lt;/i&gt;&lt;/span&gt;
                                      &lt;Field placeholder="Enter your Email" name="email" /&gt;
                                  &lt;/div&gt;
                                  {errors.email &amp;&amp; touched.email &amp;&amp; &lt;span className="mt-1 input_error"&gt;{errors.email}&lt;/span&gt;}
                              &lt;/div&gt;
  
                              &lt;div className="input_control_wrp mb-2"&gt;
                                  &lt;div className="input_control"&gt;
                                      &lt;span className="left_icon"&gt;&lt;i className="fas fa-key"&gt;&lt;/i&gt;&lt;/span&gt;
                                      &lt;Field type={this.state.pwdType} placeholder="Enter your Password" name="password" /&gt;
                                      &lt;a
                                       onClick={this.togglePwdType.bind(this)}
                                       href="javascript:void(0)"
                                       className="right_icon"&gt;
                                          &lt;i className={this.state.pwdType == 'password' ? 'fas fa-eye' : 'fas fa-eye-slash'}&gt;&lt;/i&gt;
                                       &lt;/a&gt;
                                  &lt;/div&gt;
                                  {errors.password &amp;&amp; touched.password &amp;&amp; &lt;span className="mt-1 input_error"&gt;{errors.password}&lt;/span&gt;}
                              &lt;/div&gt;
                              &lt;div className="forgot_pwd_link mb-4"&gt;
                                  &lt;a href="javascript:void(0)" className=""&gt;Forgot password?&lt;/a&gt;
                              &lt;/div&gt;
  
                              &lt;div className="input_submit"&gt;
                                  &lt;button className={ !isValid ? 'disabled_btn' : '' } type="submit"&gt;Sign In&lt;/button&gt;
                              &lt;/div&gt;
  </code></pre>
  
  <p>and my method used on submit event is below:</p>
  
  <pre><code>loginSubmit(values,formikBag) {
      console.log('formikBag',formikBag);
  }
  </code></pre>
  
  <p>I want to check if the form is valid or invalid inside the above method. </p>
  
  <p>Kindly, provide solution to accomplish it. Thanks in advance.</p>