Skip to content

Commit

Permalink
fix: broken outline links with basePath config (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
voliva authored Apr 17, 2024
1 parent 7b33927 commit 35c6314
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-poems-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vocs": patch
---

Fixed outline with basePath config
11 changes: 5 additions & 6 deletions src/app/components/Outline.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Fragment, type ReactElement, useEffect, useMemo, useRef, useState } from 'react'
import { useLocation } from 'react-router-dom'
import { Fragment, useEffect, useMemo, useRef, useState, type ReactElement } from 'react'
import { Link, useLocation } from 'react-router-dom'

import { useConfig } from '../hooks/useConfig.js'
import { useLayout } from '../hooks/useLayout.js'
Expand Down Expand Up @@ -227,18 +227,17 @@ function Items({
return (
<Fragment key={id}>
<li className={styles.item}>
{/* biome-ignore lint/a11y/useValidAnchor: */}
<a
<Link
data-active={isActive}
href={`${pathname}${hash}`}
to={`${pathname}${hash}`}
onClick={() => {
onClickItem?.()
setActiveId(id)
}}
className={styles.link}
>
{text}
</a>
</Link>
</li>
{nextLevelItems && (
<Items
Expand Down

0 comments on commit 35c6314

Please sign in to comment.