title: Handle an event and non-event function in the same way?
body: <p>I want to have a function that takes a path and navigates to it.  I'd like it to be universally usable.  Like this:</p>
  
  <pre><code>export const navigate = (path: string) =&gt; {
   getHistory().push(path)
  }
  </code></pre>
  
  <p>So, I want to be able to call it as a normal function</p>
  
  <p><code>navigate('gohere')</code></p>
  
  <p>as well as in response to an onClick action</p>
  
  <p><code>onClick={navigate('gohere')</code></p>
  
  <p>Unfortunately, that second one doesn't work.  If I add the event in like this:</p>
  
  <pre><code>export const clicknavigate = (path: string) =&gt; (event: any) =&gt; {
      getHistory().push(path)
  }
  </code></pre>
  
  <p>then it works, but that means I have to have two functions for every action - one if it is called from a click or mouse event, and one if not.</p>
  
  <p>There has to be a way to handle both with a single function?</p>