title: How to navigate outside of react component using react router 6
body: <p>Right now I have an History module, that let me use the history even outside of react component:</p>
  <pre><code>import { createBrowserHistory } from 'history';
  
  export default createBrowserHistory();
  </code></pre>
  <p>Then I use this history in App.jsx directly</p>
  <pre><code>import { Router } from 'react-router-dom';
  ...
  &lt;Router history={history}&gt;...&lt;/Router&gt;
  </code></pre>
  <p>I can import and use the same history object everywhere. Even in custom helpers outside of any react components.</p>
  <p>How could this work in <strong>react router 6</strong>?</p>
  <p>Since history is replaced with navigate, I don't see any solution yet online.</p>
  <p>I know it is still beta, but I would like to check on it in advance.</p>
  <p>Thanks for any ideas!</p>