Skip to content

Commit 004b32c

Browse files
authored
using <NextLink> instead <a> to avoid using import { addBasePath } from 'next/dist/client/add-base-path' (#2000)
1 parent 6cd1c51 commit 004b32c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/gold-clouds-guess.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@theguild/components': patch
3+
---
4+
5+
using `<NextLink>` instead `<a>` to avoid using `import { addBasePath } from 'next/dist/client/add-base-path'`

packages/components/src/components/dropdown.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client';
22

33
import { createContext, useContext, useEffect, useId, useRef, useState } from 'react';
4+
import NextLink from 'next/link';
45
import { cn } from '../cn';
56

67
interface DropdownContextValue {
@@ -169,9 +170,9 @@ interface DropdownItemProps extends React.HTMLAttributes<HTMLElement> {
169170
export function DropdownItem({ children, onClick, className, href, ...props }: DropdownItemProps) {
170171
if (href) {
171172
return (
172-
<a role="menuitem" href={href} className={className} onClick={onClick} {...props}>
173+
<NextLink role="menuitem" href={href} className={className} onClick={onClick} {...props}>
173174
{children}
174-
</a>
175+
</NextLink>
175176
);
176177
}
177178

0 commit comments

Comments
 (0)