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' }}
|
_groupHover={{ background: 'primary', color: 'bg', textDecoration: 'none' }}
|
||||||
>
|
>
|
||||||
{to ? (
|
{to ? (
|
||||||
<NextLink href={to} passHref onClick={toggleMobileAccordion}>
|
<NextLink href={to} passHref legacyBehavior>
|
||||||
<Link textDecoration='none !important'>
|
<Link textDecoration='none !important' onClick={toggleMobileAccordion}>
|
||||||
<Text
|
<Text
|
||||||
textStyle='docs-nav-dropdown'
|
textStyle='docs-nav-dropdown'
|
||||||
color={isActive ? 'primary' : 'unset'}
|
color={isActive ? 'primary' : 'unset'}
|
||||||
|
|
|
@ -25,8 +25,8 @@ export const LinksList: FC<LinksListProps> = ({ links, toggleMobileAccordion })
|
||||||
_hover={{ background: 'primary', color: 'bg' }}
|
_hover={{ background: 'primary', color: 'bg' }}
|
||||||
data-group
|
data-group
|
||||||
>
|
>
|
||||||
<NextLink href={to} passHref key={id} onClick={toggleMobileAccordion} legacyBehavior>
|
<NextLink href={to} passHref key={id} legacyBehavior>
|
||||||
<Link textDecoration='none !important'>
|
<Link textDecoration='none !important' onClick={toggleMobileAccordion}>
|
||||||
<Text
|
<Text
|
||||||
textStyle='docs-nav-links'
|
textStyle='docs-nav-links'
|
||||||
color={items || isActive ? 'primary' : 'body'}
|
color={items || isActive ? 'primary' : 'body'}
|
||||||
|
|
Loading…
Reference in New Issue