-
Notifications
You must be signed in to change notification settings - Fork 156
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
Shouldn't this need hooks? #339
Comments
I really like the API wouter has chosen. They do ship with Preact support too 👍 |
Yup. I'm not sure it makes sense to completely change the API of this module when there's an existing implementation we like. |
So what is the suggestion here? We use both preact-router and wouter or just wouter? |
@gtsop either router is a great choice 👍 Just don't try to use them at the same time, that always leads to problems regardless of the framework you're using. |
I think it might be worth exporting hooks from |
That would be great @developit
In some situation Anyway it feels like having access to the match internals through the use of a hook would be great 👍 |
Created a PR for this but I finally decided to use the Context API. The reason is to be able to keep this hook working when your app uses several Router instances. With the Context API I can ensure that I get the values corresponding to the router the component is depending on. The PR: #370 |
Should we add hooks in this?
some hooks like
useRouter
would make sense.This would allow access of current location on all components and mimic current
route
functionality by setLocation.The text was updated successfully, but these errors were encountered: