Hi, How can I access the URL parameter?
Hi, I'm trying to access the URL parameter in the 1st SS. It'll be used to fetch data. I've tried
useParams
from the react-router. It isn't working. I've tried to use the useParsed
from refine-core. that isn't working either. the id
from both returns as undefined
. I've attached all the Screenshots of my resources
, and routes
.![No description](https://cdn.answeroverflow.com/1089552738620285038/image.png)
![No description](https://cdn.answeroverflow.com/1089552738905489589/image.png)
![No description](https://cdn.answeroverflow.com/1089552739199094804/image.png)
![No description](https://cdn.answeroverflow.com/1089552739509477397/image.png)
![No description](https://cdn.answeroverflow.com/1089552739740155945/image.png)
6 Replies
Hey @thalfpant! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the useParsed documentation (https://refine.dev/docs/api-reference/core/hooks/navigation/useParsed) for more information on how to access URL parameters using refine.
----------------------
useParsed | refine
useParsed is a hook that leverages the parse method of the routerProvider to access the URL and query parameters along with the inferred resource, action and id from the URL.
<@439051486597611531> kapa.ai is still learning and improving, please let us how it did by reacting below
rival-black•2y ago
<Route path="edit/:id" element={EditVCard}
when you change :url to :id, is it work ?
absent-sapphire•2y ago
damn..... It worked! I'm really sorry. Bad mistake on my part.
Thank you very much.
rival-black•2y ago
I'm glad to hear that 🚀