title: Material UI Date Range Picker
body: <p>I'm trying to set up a material ui date range picker example following the code on the docs but it's giving me an error, TypeError: undefined is not a function.</p>
  
  <p>I've never seen useState followed by a component before and it's what's throwing the error.</p>
  
  <p><code>React.useState&lt;DateRange&gt;([null, null])</code></p>
  
  <p><a href="https://dev.material-ui-pickers.dev/demo/daterangepicker" rel="noreferrer">https://dev.material-ui-pickers.dev/demo/daterangepicker</a></p>
  
  <p>Complete Code:</p>
  
  <pre><code>import * as React from "react";
  import { TextField } from "@material-ui/core";
  import { DateRangePicker, DateRange, DateRangeDelimiter } from "@material-ui/pickers";
  
  function BasicDateRangePicker() {
    const [selectedDate, handleDateChange] = React.useState&lt;DateRange&gt;([null, null]);
  
    return (
      &lt;DateRangePicker
        startText="Check-in"
        endText="Check-out"
        value={selectedDate}
        onChange={date =&gt; handleDateChange(date)}
        renderInput={(startProps, endProps) =&gt; (
          &lt;&gt;
            &lt;TextField {...startProps} /&gt;
            &lt;DateRangeDelimiter&gt; to &lt;/DateRangeDelimiter&gt;
            &lt;TextField {...endProps} /&gt;
          &lt;/&gt;
        )}
      /&gt;
    );
  }
  
  export default BasicDateRangePicker;
  </code></pre>