title: Should React lifecycle methods be implemented in container components or presentation components?
body: <p>I'm attempting to implement <a href="https://medium.com/@learnreact/container-components-c0e67432e005#.3dxvn9hoh" rel="nofollow">container components</a> in React and Redux, and I'm unsure of what should take responsibility for lifecycle methods; containers or presentational components. One could argue that the lifecycle methods are presentational as they control DOM updates, but in that respect, aren't they also behavioural?</p>
  
  <p>Furthermore, all of the implementations of container components that I've seen thus far utilise the <a href="https://github.com/reactjs/react-redux" rel="nofollow"><code>react-redux</code></a> bindings, as do my own. Even if I keep the concerns clearly separated, is it appropriate to inherit from <code>React.Component</code> in the case of a behaviour component?</p>
  
  <p>For example, the app on which I'm working has a <code>Tab</code> presentational component, with a <code>shouldComponentUpdate</code> method:</p>
  
  <pre><code>class Tabs extends Component {
      shouldComponentUpdate(nextProps) {
          const { activeTab } = this.props;
          return activeTab !== nextProps.activeTab;
      }
  
      [...]
  }
  </code></pre>
  
  <p>On the one hand, this seems like a presentational concern as it controls when component should re-render. On the other hand, however, this is a means of handling when the user clicks a new tab, updating the application's state via an action, thus I'd class this as behavioural.</p>