title: Dispatching an action from a Redux container without extending React.Component
body: <p>I have a container component within my React and Redux application:</p>
  
  <pre><code>import { connect } from 'react-redux'
  
  import MyComponent from '../components/mycomponent'
  
  const mapStateToProps = state =&gt; ({
    myData: state.myData[state.activeDataId]
  })
  
  export default connect(mapStateToProps)(MyComponent)
  </code></pre>
  
  <p>If <code>state.myData[state.activeDataId]</code> does not exist then I want to dispatch an action to <code>fetchMyData</code> or <code>fetchMyDataIfNeeded</code>.</p>
  
  <p>Note that, at the moment, my container does not contain any JSX, it just forwards props to a presentational component. I have <a href="https://github.com/davezuko/react-redux-starter-kit/issues/909#issuecomment-230913937" rel="nofollow noreferrer">seen this being called a 'Pure Container'</a> though I'm not sure if that's a common term.</p>
  
  <p>Is there a common pattern to dispatch actions from a Pure Container? I am thinking without:</p>
  
  <ul>
  <li>expecting the presentational component to worry about this logic by passing an onLoad event to it</li>
  <li>making the container a React.Component and triggering via componentDidMount</li>
  </ul>
  
  <p>Is it a bad idea to dispatch actions from mapStateToProps, mapDispatchToProps or mergeProps?</p>