T
TanStack3y ago
fascinating-indigo

Is there a hook i can use to get the active path?

the title
4 Replies
other-emerald
other-emerald3y ago
what exactly do you define as "the active path"?
fascinating-indigo
fascinating-indigoOP3y ago
the url pathname, https://example.com/path/name/... I need to do something similar to isActive but outisde of a Link component
other-emerald
other-emerald3y ago
something like this then?
const { location } = useRouter().state;
const { location } = useRouter().state;
fascinating-indigo
fascinating-indigoOP3y ago
exactly what I was looking for i couldn't find doc for useRouter thank you, you rock

Did you find this page helpful?