title: reactjs TypeError: Object(...) is not a function when using hooks
body: <p>I am trying to export a normal functional component using the react hooks but I am getting this error.</p>
  
  <blockquote>
    <p>TypeError: Object(...) is not a function</p>
  </blockquote>
  
  <p>when I remove the hooks and export it without any states it works. Exporting the same code as a Class component also works.</p>
  
  <pre><code>import React,{ useState } from 'react';
  
  const  Mycomponent = () =&gt; {
    const [count, setCount] = useState(0);
  
    return (
      &lt;div&gt;
        &lt;p&gt;You clicked {count} times&lt;/p&gt;
        &lt;button onClick={() =&gt; setCount(count + 1)}&gt;
          Click me
        &lt;/button&gt;
      &lt;/div&gt;
    );
  }
  
  export default Mycomponent;
  </code></pre>
  
  <p>here is how I am importing and using functional component.</p>
  
  <pre><code>import Mycomponent from './mycomponet';
  class MYClassComponent extends Component {
    render() {
      return (
        &lt;Mycomponent /&gt;
      }
  }
  </code></pre>
  
  <p>I am using <code>react 16.6.3</code> and used <code>create-react-app</code>.</p>