title: Routing issue: this.context.router not defined when trying to re-route
body: <p>I'm trying to automatically <i>change the path</i> after n seconds. (without using <code>&lt;Link to="/home"&gt;Home&lt;/Link&gt;</code> ).</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>class ComponentName extends Component {
    constructor (props, context) {
      super(props, context);
    }
    componentDidMount () {
      setTimeout(function(){
        this.context.router.transitionTo('/home');
      }.bind(this), 3000)
    }
    render() {return (&lt;div&gt;..will go to the home page&lt;/div&gt;)}
  }
  
  ComponentName.contextTypes = {
    router: function () { 
      return React.PropTypes.func.isRequired;
    }
  };
  export default ComponentName;
  </code></pre>
  
  <p><b>This is the error I'm getting</b></p>
  
  <p><code>Uncaught TypeError: Cannot read property 'transitionTo' of undefined</code>
  on line <code>this.context.router.transitionTo('/home');</code> aka this.context.router is undefined.</p>
  
  <p>this.context is defined, so no problem there afaik.</p>
  
  <p><b>Things I've tried some of the following:</b>
  
  <li>In the constructor:</li></p>
  
  <pre><code>this.context = context;
  </code></pre>
  
  <p><li>In the class:</li></p>
  
  <pre><code>static contextTypes: {
    history: React.PropTypes.object,
    location: React.PropTypes.object,
    router: React.PropTypes.func.isRequired
  }
  </code></pre>
  
  <p><li>Before exporting (tried with &amp; without function):</li></p>
  
  <pre><code>ComponentName.contextTypes = {
    router: React.PropTypes.func.isRequired
  }
  </code></pre>
  
  <p><li>I've also tried changing route to history, or just calling the function on the context:</li></p>
  
  <pre><code>this.context.history.transitionTo('/home');
  this.context.transitionTo('/home');
  this.transitionTo('/home');
  </code></pre>
  
  <p>Fact is that this.context.router is still undefined, I've searched more threads (mainly this one: <a href="https://github.com/rackt/react-router/issues/975" rel="nofollow">https://github.com/rackt/react-router/issues/975</a> ) on this and still couldn't find something that would work for me.</p>
  
  <p>Note: I'm using ES6 &amp; </p>
  
  <pre><code>"react": "^0.14.0",
  "react-router": "^1.0.0-rc3"
  </code></pre>