NextLink legacyBehavior
depreciated and removed in next 16, but no replacement
#80179
-
SummaryIt's been noted that in But there doesn't seem to be a suitable replacement for having Next internal linking behavior and custom components. The docs still recommend using Am I missing something? What are people doing instead? Are they using Additional informationExample: Component: const LinkButton = styled.a What we do today: <NextLink href={'/example'} passHref legacyBehavior>
<LinkButton>Click me</LinkButton>
</NextLink>
/*
Produces:
<a href="/example" class="sc-example">Click me</a> ✅
*/ Removing <NextLink href={'/example'} passHref>
<LinkButton>Click me</LinkButton>
</NextLink>
/*
Produces:
<a href="/example">
<a class="sc-example">Click me</a> ❌
</a>
*/ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Wouldn't you be able to do: <LinkButton as={NextLink} href="/about">Click Me!</LinkButton> |
Beta Was this translation helpful? Give feedback.
Wouldn't you be able to do: