title: How to use yup resolver when fields in react hook form are variables?
body: <p>I see resolver or yup with react hook form usually setup like:</p>
  <pre><code>const validationSchema = Yup.object().shape({
    isFlag: Yup.boolean(),
  });
  </code></pre>
  <p>But in my case, I get fields of form from server, so I try as example of FAQs</p>
  <pre><code>  fields = [&quot;firstName&quot;];
    useEffect(() =&gt; {
      register(fields[0], { required: true });
    }, [register]);
  
  // in my form
  &lt;input name={fields[0]} onChange={e =&gt; setValue(fields[0], e.target.value)}/&gt;
  // How can I use yup to validate my form
  
  </code></pre>
  <p>Thanks for your help!</p>