title: React-Redux TypeError: dispatch is not a function
body: <p>I'm trying to create a Search bar to my React TODO App.</p>
  
  <p>Here's my Searchbar class:</p>
  
  <pre><code>import React, { Component } from 'react';
  import { FilterTasks } from '../../redux/actions/searchbar';
  import searchreducer from '../../redux/reducers/searchbar';
  import {connect} from 'react-redux';
  import {bindActionCreators} from 'redux';
  
  class SearchBar extends Component{
      constructor(props){
          super(props);
          this.state = {term: ''};
      }
  
      render(){
          return(
              &lt;div&gt;
              &lt;input 
                  className='searchbar' 
                  placeholder="Filter by task" 
                  onChange={term =&gt; this.props.FilterTasks(term.target.value)} /&gt;
              &lt;/div&gt;
          );
      }
  }
  
  function MapDispatchToProps(dispatch){
      return bindActionCreators({FilterTasks},dispatch); 
  }
  
  export default connect (MapDispatchToProps)(SearchBar);
  </code></pre>
  
  <p>Here's my action: </p>
  
  <pre><code>export const FilterTasks = (filter) =&gt; {
      return {
          type: 'FILTER_TASKS',
          filter
      }
  }
  </code></pre>
  
  <p>And here's my reducer: </p>
  
  <pre><code>const SearchReducer = (state = {},action) =&gt;{
      switch(action.type){
          case 'FILTER_TASKS':
          return {
              tasks: state.tasks.filter(it =&gt; it.task.toLowerCase().includes(action.filter.toLowerCase()))
          };
          break;
      }
      return state;
  }
  </code></pre>
  
  <p>When I write anything on the searchbar I automatically get the error:</p>
  
  <pre><code> Uncaught TypeError: dispatch is not a function
      at Object.FilterTasks
  </code></pre>
  
  <p>Any ideas on this?, I'm not sure if my search bar is well implemented like this.</p>