title: How to fix "dispatch is not a function" error
body: <p>I am working on a simple react-redux project that gets information about movies from the OMDB api based on search term provided by the user. I am  currently having trouble trying to get text typed into the searchbar to update the store value corresponding to the title of the film to search for. I'm fairly new to react and completely new to redux I've only finished one other redux project before and I set up my actions and reducers in the exact same way as last time but this time I'm running into "Uncaught TypeError: dispatch is not a function". This was not a problem I encountered in the previous project and my google searching has not been very helpful thus far.</p>
  
  <p>I've searched this problem on google and only found a few results and none of them seem to be having the exact same issue as me, they involve using mapDispatchToProps which I'm not using inside of my connect function. Supposedly when you write a mapStateToProps like I have, dispatch should just be passed down as a prop to the connected component but whenever I try to access it I get the aforementioned "Uncaught TypeError: dispatch is not a function" error. </p>
  
  <p>here is the index.js for my component </p>
  
  <pre><code>import { connect } from 'react-redux';
  import MovieSearch from './MovieSearchContainer';
  import { 
    updateSearchTerm,
    getMovies
  } from './movieSearchActions';
  
  function mapStateToProps(state){
    return {
      title: state.movieSearch.title,
      year: state.movieSearch.year,
      plot: state.movieSearch.plot,
      released: state.movieSearch.released,
      runtime: state.movieSearch.runtime,
      genre: state.movieSearch.genre,
      plot: state.movieSearch.plot,
      ratings: {
        IMDB: state.movieSearch.ratings.IMDB,
        Metascore: state.movieSearch.ratings.Metascore
      },
      posterUrl: state.movieSearch.posterUrl,
      cachedMovies: state.movieSearch.cachedMovies
    };
  }
  
  export default connect(mapStateToProps)(MovieSearch);
  </code></pre>
  
  <p>here is my action </p>
  
  <pre><code>export function updateSearchTerm(searchTerm){
    return {
      type: "UPDATE_SEARCH_TERM",
      payload: { searchTerm }
    }
  }
  </code></pre>
  
  <p>here is my jsx component </p>
  
  <pre><code>import React from 'react';
  import PropTypes from 'prop-types';
  import {
    updateSearchTerm,
    getMovies
  } from './movieSearchActions';
  
  export default class MovieSearchContainer extends React.Component 
  {
    constructor(props) {
      super(props);
  
      this.handleUpdateSearchTerm = 
      this.handleUpdateSearchTerm.bind(this);
    }
  
    handleUpdateSearchTerm(event){
      const { dispatch } = this.props;
      const { value } = event.target;
      dispatch(updateSearchTerm(value));
    }
  
    render() {
      return (
        &lt;div&gt;
          &lt;h1 className='text-center'&gt;Movie Finder&lt;/h1&gt;
          &lt;input type='text' className='col-sm-11' id='searchBar' 
          onChange={ this.handleUpdateSearchTerm }/&gt;
          &lt;button type='button' id='getMovies' className='col-sm- 
          1'&gt;Go!&lt;/button&gt;
        &lt;/div&gt;
      )
    }
  }
  
  MovieSearchContainer.propTypes = {
    store: PropTypes.object
  }
  </code></pre>
  
  <p>here is the reducer </p>
  
  <pre><code>export default function movieSearchReducer(state = defaultState, 
  action) {
    const { type, payload } = action;
  
    switch(type){
      case 'UPDATE_SEARCH_TERM': {
        return {
          ...state,
          title: payload.title
        }
      }
  
      default: {
        return state;
      }
    }
  }
  </code></pre>
  
  <p>I expect changes in the searchbar on the component on the page to be reflected in the redux store, but instead I just get this error</p>