I've got:
export const ACCOUNT_PORTAL_PATHS = [
'home/*',
'my-care/*',
'chats/*',
'profile/*',
'programs/*',
'completion/*',
]
If the current path is any of those, I want to know. I managed to get the current path with:
const { search: searchParams, pathname } = useLocation();
and that yields, in this example:
pathname: "/my-care/1234"
What's the best way to match?
Thanks in advance!
CodePudding user response:
If you just want to know if you are on a matching path, you can use the