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'
pull/26459/head^2
Paul Wackerow 2 years ago
parent 5f9daa4286
commit 1483d10a12
No known key found for this signature in database
GPG Key ID: BB63E296FE9CAB8D
  1. 4
      src/components/UI/docs/DocsLinks.tsx
  2. 4
      src/components/UI/docs/LinksList.tsx

@ -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…
Cancel
Save