title: Cannot read property 'dispatch' of undefined'. React
body: <p>Following is the code that I am using. I am getting an error like <code>Uncaught TypeError: Cannot read property 'dispatch' of undefined</code>. I also want to <code>dispatch</code> an action.</p>
  
  <pre><code>import { connect } from 'react-redux'
  let SearchBar = ({ dispatch }) =&gt; {
      let input
      return (
         &lt;div&gt;
             &lt;form&gt;
                &lt;input type="text" placeholder="Search"  /&gt;
                &lt;p&gt;
                   &lt;input type="checkbox" /&gt;
                   {' '}
                   Free
                &lt;/p&gt;                
             &lt;/form&gt;
         &lt;/div&gt;
     )
  }
  
  SearchBar = connect()(SearchBar)
  export default SearchBar()
  </code></pre>