absent-sapphire
absent-sapphire•2y ago

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
No description
No description
No description
No description
6 Replies
kapa.ai
kapa.ai•2y ago
Hey @thalfpant! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
kapa.ai
kapa.ai•2y ago
---------------------- 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.
kapa.ai
kapa.ai•2y ago
<@439051486597611531> kapa.ai is still learning and improving, please let us how it did by reacting below
rival-black
rival-black•2y ago
<Route path="edit/:id" element={EditVCard} when you change :url to :id, is it work ?
absent-sapphire
absent-sapphire•2y ago
damn..... It worked! I'm really sorry. Bad mistake on my part. Thank you very much.
rival-black
rival-black•2y ago
I'm glad to hear that 🚀