title: Call function every time any component updates (including route change)
body: <p>Is it possible to call a function every time <em>anything</em> in React updates?</p>
  
  <p>A little more context:
  I want to use the full capabilities of <a href="http://elementqueries.com/" rel="nofollow">EQCSS</a> in React. I've tried 2 NPM packages, but they didn't seem to do what I expected exactly.</p>
  
  <p>What I would like to do, is every time <em>any</em> component updates, I want to call <code>EQCSS.apply()</code>.</p>
  
  <p>I've tried calling in <code>componentDidUpdate</code> but this doesn't seem to work when changing pages (using react-router) for example.</p>
  
  <pre><code>import React from "react";
  import ReactDOM from "react-dom";
  
  import { Router, Route, browserHistory } from "react-router";
  
  import { MainLayout } from "./layouts";
  import {
      HomePage,
      RankingsPage
  } from "./routes";
  
  class App extends React.Component {
      render() {
          return (
              &lt;Router history={browserHistory}&gt;
                  &lt;Route component={MainLayout}&gt;
                      &lt;Route path="/" component={HomePage} /&gt;
                      &lt;Route path="/rankings" component={RankingsPage} /&gt;
                  &lt;/Route&gt;
              &lt;/Router&gt;
          );
      }
  
      componentDidUpdate() {
          console.log("COMPONENT UPDATED");
          // This does not get called when changing pages.
      }
  }
  
  // Render the main component into the dom
  ReactDOM.render(&lt;App /&gt;, document.getElementById("app"));
  </code></pre>