Skip to content

Commit

Permalink
fix: update NextLink to the new behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
fikrikarim committed Jan 4, 2023
1 parent 5ece7f2 commit c6774de
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/runtime/src/components/shared/Link/index.tsx
Expand Up @@ -123,10 +123,15 @@ export const Link = forwardRef<HTMLAnchorElement, Props>(function Link(

if (useNextLink && href != null) {
return (
<NextLink href={href}>
{/* eslint-disable-next-line */}
<a {...restOfProps} ref={ref} target={target} onClick={handleClick} />
</NextLink>
<NextLink
{...restOfProps}
ref={ref}
target={target}
onClick={handleClick}
href={href}
// Next.js v12 has legacyBehavior set to true by default
legacyBehavior={false}
/>
)
}

Expand Down

0 comments on commit c6774de

Please sign in to comment.