title: Using React router (v6) why can't I call useNavigate directly?
body: <p>I am new to React JS and a not 100% familiar with TypeScript. As I am learning I have found myself unable to understand an odd 'quirk'.</p>
  <p>My code is as follows and my question is &quot;Why do I have to make a const for useNavigate and then call it inside my method?</p>
  <pre><code>import { useNavigate } from 'react-router-dom';
  ...
   const navigate = useNavigate();
    const handleAskQuestionClick = () =&gt; {
      navigate('ask');
    };
  ...
  </code></pre>
  <p>What am I missing and why can't it be like this?</p>
  <pre><code>  const handleAskQuestionClick = () =&gt; {
      useNavigate('ask');
    };
  </code></pre>