question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pulling the params out

See original GitHub issue

It 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aleschneckcommented, May 17, 2019

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!

0reactions
EthanHaleycommented, Jun 28, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found