Pulling the params out
See original GitHub issueIt took me some digging around to figure out how to access the params from the matched route. It may be nice to include this in the readme.
<Route path="/:projectId" component={{Project}} />
<!-- Project.html -->
<h1>Project {{ match && match.params.projectId }}</h1>
or
<Route path="/:projectId" bind:match="match">
<h1>Project {{ match && match.params.projectId }}</h1>
</Route>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to Get URL Parameters with JavaScript - SitePoint
Learn how to parse query string parameters and get their values in JavaScript. Use the results for tracking referrals, autocomplete, ...
Read more >Using query parameters to create a pull request - GitHub Docs
Use query parameters to create custom URLs to open pull requests with pre-populated fields. You can use query parameters to open pull requests....
Read more >R utility for pulling out parameters for individual variable in lm ...
R utility for pulling out parameters for individual variable in lm when there are effect modifiers (interactions with categorical variables).
Read more >Get the values from the "GET" parameters (JavaScript)
@ZiTAL This function is to be used with the query part of a URL, not the entire URL. See the commented-out usage example...
Read more >URLSearchParams.get() - Web APIs - MDN Web Docs
The get() method of the URLSearchParams interface returns the first value associated to the given search parameter.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @EmilTholin, thank you very much indeed for your prompt reply. I must have missed that line and I guess I was overthinking things a bit. Cheers!
Using this method, I get an undefined error trying to access my extra props.
<Route path="{route.alias}/:id" component="{RowView}" config="{config}" route="{route}" />
config and route are objects that I have constructed in my app code, but trying to access them inside of RowView just gives me an undefined error. The id does pass through correctly however.
@EmilTholin