title: import error: 'useHistory' is not exported from 'react-router-dom'
body: <p>I am trying to import useHistory from 'react-router-dom', however, I get this error: import error: 'useHistory' is not exported from 'react-router-dom'.</p>
  <p>I have checked other answers as well such as <a href="https://stackoverflow.com/questions/62861269/attempted-import-error-usehistory-is-not-exported-from-react-router-dom">Attempted import error: &#39;useHistory&#39; is not exported from &#39;react-router-dom&#39;</a> this but to no avail. My package.json looks like this</p>
  <p><a href="https://i.stack.imgur.com/Xt2j0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Xt2j0.png" alt="package.json" /></a></p>
  <p>I am using useHistory as such,</p>
  <pre><code>import React from 'react';
  import { useState, useEffect } from 'react';
  import { useHistory } from 'react-router-dom';
  
  export default function Login(){
      const history = useHistory();
      console.log(history)
  }
  </code></pre>
  <p>However, this line works fine and does not cause import issues from react-router-dom.</p>
  <pre><code>import {BrowserRouter as Router, Switch, Route} from 'react-router-dom'
  </code></pre>
  <p>Does anyone have an idea how to solve this issue? much appreciated.</p>