title: React Router v4 navigation programmatically
body: <p>When I use react router with Redirect, Link or NavLink eveything is fine. But I need a function that navigates me to a route programmatically.</p>
  <p>That is what I want :</p>
  <pre><code>if(a == 1){
      this.context.history.push(&quot;/&quot;)
  }
  else {
      this.context.history.push(&quot;/home&quot;);
  }
  </code></pre>
  <p>As you see context history is not exists in react router v4 any more. I cannot write withroute in js code for navigation. Can anyone say me how to navigate directly in js code?</p>
  <p>Thanks</p>