title: React-redux action is not defined
body: <p>I'm trying to call an API with redux action
  but everytime I call it in my componentDidMount function, it gives me an error stating that my function is not defined.. i'm so confused, I've been using my past redux project as reference and it's using the same method but it works.</p>
  
  <p>Have a look at my codes</p>
  
  <p><strong>Reducer</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import * as types from '../actions/actionconst';
  
  const initialState = {
    isfetching: false,
    categories: [],
    error: null
  }
  const categoryReducer = (state = initialState, action) =&gt; {
    switch(action.type){
      case types.FETCH_CATEGORIES:
      console.log('in fetch categories');
      state = {
        ...state,
        isfetching: true,
        categories: action.payload
      }
      break;
      case types.FETCH_CATEGORIES_SUCCESS:
      state ={...state, categories: action.payload, isfetching: false}
      break;
  
      case types.FETCH_CATEGORIES_ERROR:
      state = {...state, isfetching: false, error: action.payload}
    }
    return state;
  }
  
  export default categoryReducer</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>Action</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import * as types from './actionconst';
  import categoryAPI from '../api/categoryAPI';
  
  export function getCategory(){
  
    return {dispatch =&gt; {
      fetch("http://localhost:8000/api/v1/categories")
      .then((response) =&gt; response.json())
      .then((responseData) =&gt; {
        dispatch({
          type: types.FETCH_CATEGORIES
          payload: responseData
        })
      })
      .catch((err) =&gt; {
        dispatch({type: types.FETCH_CATEGORIES_ERROR, payload: err});
      })
    }}
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>Container</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React, {Component} from 'react';
  import {connect} from 'react-redux';
  
  import Category from '../components/category';
  
  class CategoryContainer extends Component{
    constructor(props){
      super(props);
      console.log('category props', this.props);
    }
    componentDidMount(){
      console.log('masuk CDM');
      this.props.fetchCategory()
    }
  
    render(){
      var viewtypequery = window.innerWidth &gt;= 1025 ? "computers" : "mobile"
      return(
        &lt;Category alphabets={this.state.alph}
          categorylist={this.state.categoriestemp}
          view={viewtypequery}
          active={this.state.isActive}
        /&gt;
      )
    }
  
  }
  
  const mapStateToProps = (state) =&gt; {
    console.log('state is', state);
    return{
      categories: state.category
    }
  }
  
  const mapDispatchToProps = (dispatch) =&gt; {
      return{
        fetchCategory: () =&gt; {
          console.log('cuk ta');
          dispatch(getCategory())
        }
      }
  }
  
  export default connect(mapStateToProps, mapDispatchToProps)(CategoryContainer)</code></pre>
  </div>
  </div>
  </p>
  
  <p>I dont know if I miss something, It's been a while since I touch this project, been rewatching redux tutorial but I still couldn't find any solutions..</p>