withRouter?
mellis481 opened this issue · comments
Mike Ellis commented
I have a scenario where I need to call route()
in my application from a component that is outside of <Router>
. When I do this, the ROUTERS
array in the internal preact-router
code is empty. I'm, therefore, concluding that route()
will only work if called from a component within <Router>
.
In react-router
, I believe this would be a situation where the component that calls route()
(that lives outside of <Router>
) could simply be wrapped in withRouter
and it would work.
How can I get route()
to work outside of <Router>
without withRouter
?