Skip to content

Commit fb37954

Browse files
author
0xOZ
committed
Removed hash from asPath function
1 parent 6d486b7 commit fb37954

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/Link.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ export const BaseLink = forwardRef(function Link(
5858
ref
5959
) {
6060
const { asPath } = useRouter()
61+
const cleanAsPath = asPath.replace(/#.*/, "");
6162
const { flipForRtl } = useRtlFlip()
6263

6364
let href = (to ?? hrefProp) as string
6465

65-
const isActive = url.isHrefActive(href, asPath, isPartiallyActive)
66+
const isActive = url.isHrefActive(href, cleanAsPath, isPartiallyActive)
6667
const isDiscordInvite = url.isDiscordInvite(href)
6768
const isPdf = url.isPdf(href)
6869
const isExternal = url.isExternal(href)

0 commit comments

Comments
 (0)