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

How to get route params? #54

Open
alexeymakarov90 opened this issue Jul 31, 2018 · 4 comments
Open

How to get route params? #54

alexeymakarov90 opened this issue Jul 31, 2018 · 4 comments

Comments

@alexeymakarov90
Copy link

alexeymakarov90 commented Jul 31, 2018

If we use @withRouter we will receive "match" in props.
How can we get match.params from routingStore ?

  • Except by parsing the location by own regexp
@alisd23
Copy link
Collaborator

alisd23 commented Aug 17, 2018

There's currently no support for url match params in the store. Because of the fact you can use the same param names multiple times in an app, at different levels, there could be conflicts with the names.

I know that react-router-redux and connected-react-router also don't support this. You'll just have to access the match params through your Router/Match components.

@damonmaria
Copy link

FYI you can call matchPath which will get the match for you from a given path.

@ikatun
Copy link

ikatun commented Feb 19, 2019

@damonmaria is there a way to extract the currently active path (or a list of paths) from the router which I could give as a path argument to matchPath?

@damonmaria
Copy link

@ikatun location.pathname in the RouterStore has the current path.

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

No branches or pull requests

4 participants