Skip to content

Commit

Permalink
fix: sidebar active invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyuan0704 committed Sep 18, 2022
1 parent f22c3a6 commit 4be2c90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/theme-default/components/Siderbar/index.tsx
Expand Up @@ -24,7 +24,7 @@ export function SideBar() {
if ('items' in item) {
children = item.items.map((child) => renderGroupItem(child, depth + 1));
}
const isActive = location.pathname.startsWith(normalizeHref(item.link));
const isActive = location.pathname.startsWith(item.link!);
return (
<div style={{ marginLeft }}>
<div className={`${styles.link} ${isActive ? styles.active : ''}`}>
Expand Down

0 comments on commit 4be2c90

Please sign in to comment.