title: Is it possible to use react-datepicker with react hooks forms?
body: <p>Is it possible to use react-datepicker with react hooks forms? I tried following sample:</p>
  
  <p><a href="https://codesandbox.io/s/awesome-shape-j0747?fontsize=14&amp;hidenavigation=1&amp;theme=dark" rel="noreferrer">https://codesandbox.io/s/awesome-shape-j0747?fontsize=14&amp;hidenavigation=1&amp;theme=dark</a></p>
  
  <p>But with no luck.</p>
  
  <pre><code>import React, { useState } from "react";
  import "./styles.css";
  import { useForm } from "react-hook-form";
  import { Row, Col, Form, FormGroup, Label, Input, Button } from "reactstrap";
  import DatePicker from "react-datepicker";
  
  export default function App() {
    const { register, handleSubmit } = useForm();
    const [startDate, setStartDate] = useState();
    const [result, setResult] = useState();
  
    const onSearch = event =&gt; {
      setResult(event);
    };
  
    return (
      &lt;div className="App"&gt;
        &lt;Form onSubmit={handleSubmit(onSearch)}&gt;
          &lt;Row&gt;
            &lt;Col&gt;
              &lt;FormGroup&gt;
                &lt;Input
                  type="number"
                  name="account"
                  id="account"
                  placeholder="AccountId"
                  innerRef={register({ required: true, maxLength: 20 })}
                /&gt;
              &lt;/FormGroup&gt;
            &lt;/Col&gt;
          &lt;/Row&gt;
  
          &lt;Row&gt;
            &lt;Col&gt;
              &lt;DatePicker
                innerRef={register}
                name="datetime"
                className={"form-control"}
                selected={startDate}
                onChange={date =&gt; setStartDate(date)}
                showTimeSelect
                timeFormat="HH:mm"
                timeIntervals={15}
                timeCaption="time"
                dateFormat="MM-dd-yyyy h:mm"
              /&gt;
            &lt;/Col&gt;
          &lt;/Row&gt;
  
          &lt;Button&gt;Submit&lt;/Button&gt;
        &lt;/Form&gt;
        &lt;div&gt;{JSON.stringify(result)}&lt;/div&gt;
      &lt;/div&gt;
    );
  }
  </code></pre>