We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3fb6803 commit 12a418fCopy full SHA for 12a418f
packages/site/src/app/routes/layout/Sidebar.tsx
@@ -23,8 +23,8 @@ export function AppSidebar(props: AppSidebarProps): JSX.Element | null {
23
24
const location = useLocation();
25
const page = location.pathname.startsWith('/docs') ? 'Docs' : location.pathname.startsWith('/components') ? 'Components' : null;
26
- const regex = new RegExp(String.raw`(?<=^\/${page === 'Docs' ? 'docs' : 'components'}\/).+$`);
27
- const activeId = location.pathname.match(regex)?.[0] ?? null;
+ const regex = new RegExp(String.raw`^\/${page === 'Docs' ? 'docs' : 'components'}\/(.+$)`);
+ const activeId = location.pathname.match(regex)?.[1] ?? null;
28
29
const menuNode = (
30
<DMenu
0 commit comments