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.

how do i get query string inside a component?

See original GitHub issue

I’m passing /login?ref=<original-route> if they arent’ logged in. In my Login component I need to redirect them to params.ref. how do I get that info?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jorgegorkacommented, Oct 24, 2019

Hi @chovy :

You are right this is a bug. I’m working on the fix.

0reactions
ralyodiocommented, Oct 25, 2019

i commented on the wrong ticket. this one works now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - How to get parameter value from query string?
1. use regular expression to get query string. Save this answer. Show activity on this post.
Read more >
How to Get Parameter Value from Query String in React?
useLocation hook is used to get the URL data properly. Then, you get the query string from the “search” property. Next, it passes...
Read more >
How to get Query Parameters and URL Parameters in React
Tutorial on different ways to read query and URL parameters. Explains about how to get query & URL parameters using URLSearchParams, ...
Read more >
How to get the query params in React
To get the query parameter from a above url, we can use the useLocation() hook in react router v5. Items.js. import React from...
Read more >
Getting Query Strings (Search Params) in React Router
First you'll need to import the useSearchParams hook and destruct the return value to get the current value of, React Router v6 calls...
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