title: How can I use yup validationSchema with react-hook-form?
body: <p>I'm using react-hook-form library and yup to validate input fields :</p>
  <pre><code>const { handleSubmit, register, errors } = useForm({
          mode: 'onBlur',
          validationSchema: Yup.object({
              name: Yup.string().max(6, 'Max 6 chars').required('Required boy'),
              pass: Yup.string().min(6, 'Min 6 chars').required('Required boy')
          })
      });
  
      const submit = (e) =&gt; {
          alert(e.name + ' ' + e.pass);
      };
  
      return (
          &lt;div className=&quot;App&quot;&gt;
              &lt;form onSubmit={handleSubmit(submit)}&gt;
  
                  &lt;input id=&quot;name&quot; type=&quot;text&quot; name=&quot;name&quot; ref={register} /&gt;
                  {errors.name &amp;&amp; &lt;div&gt;{errors.name.message}&lt;/div&gt;}
  
                  &lt;input id=&quot;pass&quot; type=&quot;password&quot; name=&quot;pass&quot; ref={register} /&gt;
                  {errors.pass &amp;&amp; &lt;h3&gt;{errors.pass.message}&lt;/h3&gt;}
  
                  &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;
  
              &lt;/form&gt;
          &lt;/div&gt;
      );
  </code></pre>
  <p>It doesn't throw an error in the console and it alerts when I click submit button but the validation doesn't work at all .</p>
  <p>I expect the error message to show up when the input is touched and the value is less or more than the required value .</p>
  <p>How can I use yup properly with react-hook-form ?</p>