-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Get params outside of a component #3015
Comments
Thanks for your question! We want to make sure that the GitHub issue tracker remains the best place to track bug reports and feature requests that affect the development of React Router. Questions like yours deserve a purpose-built Q&A forum. Could you post this question to Stack Overflow with the tag #react-router? https://stackoverflow.com/questions/ask?tags=react-router We also have an active and helpful React Router community on Reactiflux, which is a great place to get fast help with React Router and with the rest of the React ecosystem. You can join at https://discord.gg/0ZcbPKXt5bYaNQ46. |
I found the question that the issue opener posted: https://stackoverflow.com/questions/35160459/get-params-outside-of-a-component. However, there's no response after 2 weeks and I'd like to be able to access params outside of components as well. I'm finding a lot of info on doing this with react-router verion < 2.0, but none with 2.0. |
After some more digging, this appears to be an open issue (#2547) and is unresolved so far. |
I would like to retrieve the current params outside of a component, and as far as I can tell React Router does not provide a convenient way of doing that.
Sometime back before 0.13 the router had getCurrentParams() which is what I used to use.
Now the best thing I can figure out is:
This is pretty ugly, and I was hoping for a more elegant solution.
The text was updated successfully, but these errors were encountered: