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