exotic-emerald•4y ago
How to get params from url in refine?
I want to access the params from url in edit page. How can I achieve that? My edit page url is
s/locations/edit/1425 now I want to access the id 1425. I am using react-router-v65 Replies
like-gold•4y ago
Hi @dipbazz,
can u try this ?
you should see your params in
params object
or you can use
useResource hook ⚡
https://refine.dev/docs/api-reference/core/hooks/resource/useResource/like-gold•4y ago
oh, sorry.
useResource is much easier and it's best practice 🙏 thank youuseResource is sufficient to access the "id" parameter, but @alicanerdurmaz 's way can be used to access custom parameters
exotic-emeraldOP•4y ago
Thank you @alicanerdurmaz and @Omer for your response.