title: React TypeScript Change route programmatically with BrowserRouter
body: <p>Im using <code>BrowserRouter</code> to manage the routing. I have a function that when its called I want to change the route without a page refresh.</p>
  
  <pre><code>import React from 'react';
  const myPage: React.FC = (props) =&gt; {
    function loadPage(event: any) {
      if (event.target.id) {
        window.history.push('/' + event.target.id)
      }
    return (
      &lt;div id='home' onClick={loadPage}&gt;&lt;div/&gt;
      &lt;section&gt; {props.children} &lt;/section&gt;
    )
  ...
  </code></pre>
  
  <p>The error im getting is <code>Property 'push' does not exist on type 'History'.ts(2339)</code></p>
  
  <p><strong>Note</strong>: the router is a child of this element and is being passed into props.children</p>