title: "Uncaught TypeError: history.push is not a function" error occurs
body: <p>I have been developing a navigation bar. I wrote a function to switch screens and call it in button onClick. I wrapped the component in <code>withRouter</code> also. But the following error occurs:</p>
  
  <blockquote>
    <p>Uncaught TypeError: history.push is not a function" error.</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code>import { withRouter } from 'react-router-dom';
  
  function Navigation(history) {
    const abc = path =&gt; {
      history.push(path);
    };
  
  return(
  &lt;button onClick={() =&gt; abc('/user')}&gt;User&lt;/button&gt;
  );}
  
  export default withRouter(Navigation);
  </code></pre>
  
  <p>Thank you</p>