title: Uncaught (in promise) TypeError: Cannot read property 'dispatch' of undefined
body: <p>I am using React Redux. Getting error - Uncaught (in promise) TypeError: Cannot read property 'dispatch' of undefined</p>
  
  <p>Below is what console shows</p>
  
  <p><a href="https://i.stack.imgur.com/RcsCl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RcsCl.jpg" alt="enter image description here"></a></p>
  
  <p>I know I am really close because it worked briefly and I added some code that messed it up. I was seeing the payload for GET_RESULTS but now I do not because of this error.</p>
  
  <p>This is what I call when <strong>submit</strong> button on search form is clicked. I get data from the API and that part works fine.  </p>
  
  <pre><code>.....
  import { store } from '../../../store/store'
  import { getSearchResults } from '../../../actions/searchresults'
  ....
  ...
     handleSubmit(event) {
      event.preventDefault()
      get(`apiURLHere`, { maxContentLength: 400 })
      .then((data) =&gt; store.dispatch(getSearchResults(data)))
    }
  </code></pre>
  
  <p>Here is my <strong>action</strong> - </p>
  
  <pre><code>export const getSearchResults = username =&gt; {
    return {
      type: 'GET_RESULTS',
      payload: username,
    }
  }
  </code></pre>