title: How can I inject a common code in components in React
body: <p>For multiple React component , I want to inject a common code to the life cycle of React.<br>
  Is there something good way?</p>
  
  <pre><code>var ComponentA = React.createClass({
      componentWillMount: function () {
  
      },
      componentDidUpdate: function(){
        //inject common code
      },...
  
  var ComponentB = React.createClass({
      componentWillMount: function () {
  
      },
      componentDidUpdate: function(){
        //inject common code
      },...
  </code></pre>