title: Alternative for useDispatch hook of react-redux for Class Component in React
body: <p><code>react-redux</code> library has come up with <code>useDispatch</code>, which being a hook can only be used in function component.</p>
  <pre><code>import React from 'react';
  import {useDispatch} from 'react-redux';
  import {action} from './actions';
  
  const funComp = () =&gt; {
    const dispatch = useDispatch();
    const performAction = () =&gt; { dispatch(action()) }
    return &lt;button onClick={performAction}&gt; Dispatch Action &lt;/button&gt;
  }
  </code></pre>
  <p>This simplifies a lot of boiler-plate code for functional component, is there something similar which we can use in class component?</p>