title: How to select time and date range with React DatePicker
body: <p>I'm using React Date Picker and I need to include time along with Date range for a single input. I didn't find any example from documentation how to implement this. Does DatePicker provide any functionality ?</p>
  <p>the component is written as</p>
  <p>after changing the date it throws err:
  &quot;TypeError: dateRange is not iterable&quot;</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React, { useState } from 'react';
  import DatePicker from "react-datepicker";
  import "react-datepicker/dist/react-datepicker.css";
  
  
  function CustomDatePicker(props: any) {
    
    const [dateRange, setDateRange] = useState([null, null]);
    const [startDate, endDate] = dateRange;
    return (
    &lt;DatePicker
     selectsRange={true}
     startDate={startDate}
     endDate={endDate}
     timeInputLabel="Time:"
     onChange={(update: any) =&gt; {
     setDateRange(update);
     }}
     dateFormat="MM/dd/yyyy h:mm aa"
     isClearable={true}
     showTimeSelect
     /&gt;
    );
  }`
  
  export default CustomDatePicker;</code></pre>
  </div>
  </div>
  </p>