title: Unable to render functional component with React Hooks
body: <p>I'm new to react hooks. I'm trying to use the following component as the filter input element for one of the columns in a ReactTable component.</p>
  
  <pre class="lang-js prettyprint-override"><code>import React, { useState } from 'react'
  import DatePicker from 'material-ui/DatePicker/DatePickerDialog'
  
  import '../styles/style.less'
  
  export default function DateRange({ startLabel = 'From', endLabel = 'To' } = {}) {
    const [open, setOpen] = useState(false)
  
    return (
      &lt;div className="date-range"&gt;
        &lt;input type="text" placeholder={startLabel} onClick={() =&gt; setOpen(true)} /&gt;
        &lt;input type="text" placeholder={endLabel} /&gt;
        &lt;DatePicker open={open} /&gt;
      &lt;/div&gt;
    )
  }
  </code></pre>
  
  <p>but the render fails with the following error:</p>
  
  <pre><code>Uncaught Invariant Violation: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app
  </code></pre>