Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match and activeClassName not working on page load. #412

Open
three-fourteen opened this issue Dec 23, 2021 · 5 comments
Open

Match and activeClassName not working on page load. #412

three-fourteen opened this issue Dec 23, 2021 · 5 comments

Comments

@three-fourteen
Copy link

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.

@developit
Copy link
Member

Can you re-test this with the recently-released preact-router version 4?

@developit
Copy link
Member

The initial page load issue may be addressed via #416. The activeClassName and Match usage should be fixed by #416 though.

@three-fourteen
Copy link
Author

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.

@orangecoloured
Copy link

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.

@ArcadeRenegade
Copy link

I am still seeing this behavior in v4.1.0

activeClassName does not work for a default route on page load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants