title: React Hook Form with datepicker Range doesn't pick date
body: <p>I got the following datepickers.<br />
  For the Start Date:</p>
  <pre><code>&lt;Controller
      as={
          &lt;DatePicker
              selected={travelRoute?.dateStart || new Date()}
              selectsStart
              startDate={travelRoute?.dateStart}
              endDate={travelRoute?.dateEnd}
              inline
          /&gt;
      }
      control={control}
      rules={{ required: true }}
      valueName=&quot;selected&quot;
      onChange={date =&gt; handleStartDateOnChange(date)}
      name=&quot;dateStart&quot;
      placeholderText=&quot;Select date&quot;
      defaultValue={null}
  /&gt;  
  </code></pre>
  <p>For the End Date:</p>
  <pre><code>&lt;Controller
     as={
      &lt;DatePicker
          name=&quot;dateEnd&quot;
          selected={travelRoute?.dateEnd || new Date()}
          onChange={date =&gt; handleEndDateOnChange(date)}
          selectsEnd
          startDate={travelRoute?.dateStart}
          endDate={travelRoute?.dateEnd}
          minDate={travelRoute?.dateStart}
          inline
      /&gt;
     }
     control={control}
     rules={{ required: true }}
     valueName=&quot;selected&quot;
     onChange={date =&gt; handleEndDateOnChange(date)}
     name=&quot;dateEnd&quot;
     placeholderText=&quot;Select date&quot;
     defaultValue={null}
  /&gt;  
  </code></pre>
  <p>Do  I need to add the datepicker props to the datepicker component or to the Controller Component?<br />
  The start Datepicker doesn't select the date and the end Datepicker doesn't change the startdate and isn't displaying the range.</p>
  <p>I'm saving the data into the travelRoute state with setTravelRoute which is happening in the handleOnChange functions.</p>
  <p>EDIT:<br />
  Added onChange handler:</p>
  <pre><code>const handleStartDateOnChange = date =&gt; {
      setTravelRoute(prevState =&gt; ({
          ...prevState,
          dateStart: date
      }))
  };
  
  const handleEndDateOnChange = date =&gt; {
      setTravelRoute(prevState =&gt; ({
          ...prevState,
          dateEnd: date
      }))
  };
  </code></pre>