diff --git a/src/components/SubNavigationPills/index.tsx b/src/components/SubNavigationPills/index.tsx index 8bc7df806..047e6b81f 100644 --- a/src/components/SubNavigationPills/index.tsx +++ b/src/components/SubNavigationPills/index.tsx @@ -61,8 +61,7 @@ const SubNavigationPills: FC = ({ links }) => { const NavPill: FC = ({ path, pathOverride, title, resolvedPaths }) => { let isActive = false const resolved = useResolvedPath(pathOverride || path) - const { pathname } = useLocation() - const match = matchPath(resolved.pathname, pathname) + const match = useMatch({ path: resolved.pathname, end: true }) if (match) { if (match.params["*"]) { const lastPieceOfPath = match.pathname.replace(match.pathnameBase, "")