title: this.context.router.push is not working
body: <p>I am using react router 4.0 version. I am trying to navigate from one component to another on button click. I have implemented react routing for this.
  After implementation when i click the navigate button it is giving me error "Uncaught TypeError: this.context.router.push is not a function" and a warning 
  "Failed context type: Invalid context <code>router</code> of type <code>object</code> supplied to <code>EmpLogin</code>, expected <code>function</code>." Tried a lot but could not make it working. below are my component and routing implementation. Earlier i was using react router 2.0 and browserhistory.push was working.</p>
  
  <pre><code>export class EmpLogin extends React.Component {
    constructor(props) {
  super(props);
  this.state = {
  
  };
  }
  
  loginID(e) {
  this.setState({loginID: e.target.value});
  }
  
   Password(e) {
  this.setState({password: e.target.value});
  }
  
   navigate(e){
      e.preventDefault();
      this.context.router.push('/EmpDetails');
    }
  
  render() {
    return (
      &lt;div&gt;
      &lt;div &gt;
        &lt;form&gt;
          &lt;input type="text" onChange={this.loginID.bind(this)} /&gt;
          &lt;input type="password" onChange={this.Password.bind(this)} /&gt;  
          &lt;div&gt;
              {this.props.children}
              &lt;button onClick={this.navigate.bind(this)}&gt;feature&lt;/button&gt;
          &lt;/div&gt;
        &lt;/form&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  );
   }
   }
  
    EmpLogin.contextTypes = {
    router: React.PropTypes.func.isRequired
   }
  
   export default EmpLogin;
  </code></pre>
  
  <p>Routing implementation - </p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import EmpLogin from './EmpLogin';
  import {Router, Route,HashRouter} from 'react-router-dom';
  import {browserHistory,hashHistory} from 'react-router';
  import EmpDetails from './EmpDetails';
  
  ReactDOM.render((
   &lt;HashRouter&gt;
   &lt;div&gt;
    &lt;Route exact path='/' component={EmpLogin}/&gt;
    &lt;Route path='/Emplogin' component={EmpLogin}/&gt;
    &lt;Route path='/EmpDetails' component={EmpDetails} /&gt;
    &lt;/div&gt;
    &lt;/HashRouter&gt;
   ), document.getElementById('root'));
  </code></pre>