title: Action not being fired - react-redux counter example
body: <p>I'm trying to setup up my react project with redux and I'm following a basic example with a <code>counter</code>, which I can increment and decrement. The counter displays correctly on the page as <code>0</code> initially - however when I hit the button, the <code>increment</code> action doesn't seem to be dispatched, and as a consequence, the counter does not update. </p>
  
  <p>My <code>LoginPage.js</code>:</p>
  
  <pre><code>/* eslint-disable no-unused-expressions */
  import { connect } from "react-redux";
  import React, { Component } from "react";
  import { selectCounter } from "./../../selectors/counter";
  import { actions as counterActions } from "./../../actions/counter";
  
  class LoginPage extends Component {
    componentDidMount() {}
  
    render() {
      const { counter, increment } = this.props;
      return (
        &lt;div&gt;
          &lt;p&gt;{`Hi ${counter}`}&lt;/p&gt;
          &lt;button onClick={() =&gt; increment()}&gt;+&lt;/button&gt;
        &lt;/div&gt;
      );
    }
  }
  
  LoginPage = connect(
    (state, props) =&gt; ({
      counter: selectCounter(state, props)
    }),
    { ...counterActions }
  )(LoginPage);
  
  export default LoginPage;
  </code></pre>
  
  <p>My <code>actions/counter.js</code>:</p>
  
  <pre><code>import { INCREMENT } from "./../types/counter";
  
  const increment = () =&gt; {
    return { type: INCREMENT };
  };
  
  export const actions = {
    increment
  };
  </code></pre>
  
  <p>My <code>/reducers/counter.js</code>:</p>
  
  <pre><code>const { INCREMENT, DECREMENT } = "./../types/counter";
  
  const counterReducer = (state = 0, action) =&gt; {
    switch (action.type) {
      case INCREMENT:
        return state + 1;
      case DECREMENT:
        return state - 1;
      default:
        return state;
    }
  };
  
  module.exports = { counterReducer };
  </code></pre>
  
  <p>My <code>/reducers/index.js</code>:</p>
  
  <pre><code>import { combineReducers } from "redux";
  import { counterReducer } from "./counter";
  
  const rootReducer = combineReducers({
    counter: counterReducer
  });
  
  export default rootReducer;
  </code></pre>
  
  <p>I'm omitting the <code>App.js</code> and <code>index.js</code> files as these are pretty simple and don't seem to be related to the problem.</p>
  
  <p>UPDATE: </p>
  
  <p>My <code>actions/counter.js</code>:</p>
  
  <pre><code>import { INCREMENT } from "./../types/counter";
  import { useDispatch } from "react-redux";
  
  const increment = () =&gt; {
    return { type: INCREMENT };
  };
  
  const mapDispatchToProps = dispatch =&gt; {
    return {
      increment: () =&gt; dispatch(increment())
    };
  };
  
  export const actions = {
    ...mapDispatchToProps(useDispatch)
  };
  </code></pre>
  
  <p>Now I am seeing the bug: </p>
  
  <p><code>react-dom.development.js:14724 Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app
  </code></p>