title: React useEffect is not triggering on link to route change
body: <p>I have the following code within a component called <code>AllJobs</code></p>
  <pre><code>                            &lt;TableCell&gt;
                                      &lt;Link
                                          to={`/job/${item.id}`}
                                          style={{ textDecoration: 'underline', color: 'black' }}
                                      &gt;             
                                       {item.id}
                                      &lt;/Link&gt;
                              &lt;/TableCell&gt;
  </code></pre>
  <p>When the user clicks on this link, it then calls the component <code>JobDetails</code> as per below route, within my App.js file:</p>
  <pre><code>&lt;Router&gt;
    &lt;Switch&gt;
      &lt;Route exact path=&quot;/job/:id&quot;&gt;
        &lt;JobDetails /&gt;
      &lt;/Route&gt;
    &lt;/Switch&gt;
  &lt;/Router&gt;
  </code></pre>
  <p>My problem is, within my <code>JobDetails</code> component, I have a useEffect that isn't being fired and unsure why it isn't as I need it to call my <code>getJob()</code> function?</p>
  <pre><code>export default function JobDetails() {
  
  const { id } = useParams();
  
  const [currentJob, setCurrentJob] = useState([]);
  
  const getJob = async () =&gt; {
      console.log(&quot;Inside JobDetails for id:&quot;, id)
      try {
        const response = await fetch(`http://localhost:3000/get-job/${id}`);
        const currentJobRec = await response.json();
        console.log(&quot;current-job&quot;, currentJobRec)
            
        setCurrentJob(currentJobRec);
      } catch (err) {
        console.error(err.message);
      }
    }; 
  
    useEffect(() =&gt; {
      getJob();
    }, []);  
  </code></pre>
  <p>Can anyone please assist as to what I am missing as I need to trigger off the useEffect().</p>