fix onClick vs legacyBehavior
adds missing legacyBehavior attribute to NextLink tags to prevent nesting anchor elements which was causing hydration warnings. Also fixes 'The legacy behavior requires onClick be set on the child of next/link'
This commit is contained in:
parent
5f9daa4286
commit
1483d10a12
|
@ -53,8 +53,8 @@ export const DocsLinks: FC<Props> = ({ navLinks, toggleMobileAccordion }) => {
|
|||
_groupHover={{ background: 'primary', color: 'bg', textDecoration: 'none' }}
|
||||
>
|
||||
{to ? (
|
||||
<NextLink href={to} passHref onClick={toggleMobileAccordion}>
|
||||
<Link textDecoration='none !important'>
|
||||
<NextLink href={to} passHref legacyBehavior>
|
||||
<Link textDecoration='none !important' onClick={toggleMobileAccordion}>
|
||||
<Text
|
||||
textStyle='docs-nav-dropdown'
|
||||
color={isActive ? 'primary' : 'unset'}
|
||||
|
|
|
@ -25,8 +25,8 @@ export const LinksList: FC<LinksListProps> = ({ links, toggleMobileAccordion })
|
|||
_hover={{ background: 'primary', color: 'bg' }}
|
||||
data-group
|
||||
>
|
||||
<NextLink href={to} passHref key={id} onClick={toggleMobileAccordion} legacyBehavior>
|
||||
<Link textDecoration='none !important'>
|
||||
<NextLink href={to} passHref key={id} legacyBehavior>
|
||||
<Link textDecoration='none !important' onClick={toggleMobileAccordion}>
|
||||
<Text
|
||||
textStyle='docs-nav-links'
|
||||
color={items || isActive ? 'primary' : 'body'}
|
||||
|
|
Loading…
Reference in New Issue