Open three-fourteen opened 2 years ago
Can you re-test this with the recently-released preact-router version 4?
The initial page load issue may be addressed via #416. The activeClassName and Match usage should be fixed by #416 though.
Sorry I didn't reply but I due to the lack of response and requirement was pretty simple I opted for using a custom solution for the router. Thanks anyway.
I've just tested and it's working. No need to put a component inside a router anymore to use useRouter
and the activeClassName
works properly.
I am still seeing this behavior in v4.1.0
activeClassName
does not work for a default
route on page load.
I'm using custom history with "createHashHistory" and the page URL is something like "example.com/dash?id=3&token=tokenValue". When the page load and activeClassName from doesn't workg but as soon as navigate through the menu start working. Also, the back and forward from the brower it's a little bit buggy, while the URL is updated, Match, activeClassName and the router don't always work as expected.