Skip to content

Commit

Permalink
feat: split next/link props type
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSuperDev authored and theodorusclarence committed Dec 2, 2021
1 parent 22653ef commit a7e3630
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/links/UnstyledLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ export type UnstyledLinkProps = {
children: React.ReactNode;
openNewTab?: boolean;
className?: string;
} & React.ComponentPropsWithoutRef<'a'> &
LinkProps;
nextLinkProps?: Omit<LinkProps, 'href'>;
} & React.ComponentPropsWithoutRef<'a'>;

export default function UnstyledLink({
children,
href,
openNewTab,
className,
nextLinkProps,
...rest
}: UnstyledLinkProps) {
const isNewTab =
Expand All @@ -23,7 +24,7 @@ export default function UnstyledLink({

if (!isNewTab) {
return (
<Link href={href}>
<Link href={href} {...nextLinkProps}>
<a {...rest} className={className}>
{children}
</a>
Expand Down

0 comments on commit a7e3630

Please sign in to comment.