Skip to content

Commit 46e9e0a

Browse files
committed
Fix NavLinks
1 parent 292a83f commit 46e9e0a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/docs/src/components/sidenav.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ type NavLinksProps = {
179179
}) => JSX.Element
180180
}
181181
const NavLinks = ({ open, links, Link }: NavLinksProps) => {
182-
if (!links) return null
183-
if (!open) return null
182+
if (!links || !open) return null
184183
return (
185184
<ul
186185
sx={{
@@ -275,9 +274,11 @@ export const AccordionNav = forwardRef<HTMLDivElement, AccordionNavProps>(
275274
/>
276275
)}
277276
</div>
278-
{pathname.includes(href) && (
279-
<NavLinks open={expanded[i]} Link={Link} links={children} />
280-
)}
277+
<NavLinks
278+
open={pathname.includes(href) || expanded[i]}
279+
Link={Link}
280+
links={children}
281+
/>
281282
</li>
282283
))}
283284
</ul>

0 commit comments

Comments
 (0)