Replies: 1 comment
-
Hey! First of all, thank you for choosing wouter. This is essentially the same method wouter returns as a second element from |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to replace react router with Wouter, especially because navigate out of the component is a pain, which is useful/needed with applications using Redux/Saga for redirects.
What is the recommended method with Wouter ?
Since Wouter uses the History API, is there a problem with using the History API directly in these cases?
Something like that?
export const navigate = (to) => { window.history.pushState(null, '', to); window.dispatchEvent(new PopStateEvent('popstate')); };
If not, it think it will be interesting to add few line about it, since in react router it changes often, it breaks and nothing official about it.
Beta Was this translation helpful? Give feedback.
All reactions