How do you get the query parameters from the URL in Preact using TypeScript ? #4408
-
How are you ? Community. Now I am using Preact for my project. but I had a any problem with this. I am going to get params from router. but it seems there is no way to get param in preact. How can I solve this problem ? in this URL, how can I get token value ? please help me. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Which router are you referring to? Preact itself isn't relevant here, it has no relation to URLs.
|
Beta Was this translation helpful? Give feedback.
-
thank you for your response @rschristian . I solve this problem by using component props. btw, thanks again |
Beta Was this translation helpful? Give feedback.
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