Skip to content

How do you get the query parameters from the URL in Preact using TypeScript ? #4408

Answered by rschristian
tsolutionsx asked this question in Q&A
Discussion options

You must be logged in to vote

I am going to get params from router. but it seems there is no way to get param in preact

Which router are you referring to?

Preact itself isn't relevant here, it has no relation to URLs.

new URL('http://localhost:5173/home?auth=true&token=pXVCJ9.eyJpZCI6IjY2NmIzZGU5MzBmOGUwOGIyZDIyOWE1ZCIsImVtYWlsIjoidGVjaHNvbHV0aW9uc3g3MDlAZ21haWwuY29tIiwiaWF0IjoxNzE4MzE0MTM1LCJleHAiOjE3MTg0MDA1MzV9.M4EF2CveuRdfmgwTL9eLkG8qvAL7PBG6dXEw4OuouIE').searchParams

Docs

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rschristian
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants