title: How to use React Hook Form with RNPickerSelect in React Native?
body: <p>I am trying to use RNPickerSelect (<a href="https://github.com/lawnstarter/react-native-picker-select" rel="nofollow noreferrer">https://github.com/lawnstarter/react-native-picker-select</a>) with react-hook-form in React Native. I've tried with Controller wrapper to use RNPickerSelect component. And it always invokes 'required' error. Could someone please point me to right direction? Here is my code.</p>
  <pre><code>const CategoryContentView = () =&gt; {
     const tempData = [];
     categories.forEach((data) =&gt; {
       tempData.push({ label: `${data.name}`, value: `${data.id}` });
     });
     return (
       &lt;&gt;
         &lt;Controller
           as={
             &lt;RNPickerSelect
             onValueChange={(value) =&gt; {
               setCategory(value);
             }}
             items={tempData}
           /&gt;}
           rules={{
           required: true,
         }}
           control={control}
           name=&quot;category&quot;
           valueName=&quot;value&quot;
           onChange={([value]) =&gt; value}
           error={!!get(errors, 'category')}
         /&gt;
         {errors.category &amp;&amp; &lt;ErrorView errors={['this is required']} /&gt;}
       &lt;/&gt;
   };
  </code></pre>
  <p>Thank you in advance</p>