// eslint-disable-next-line no-restricted-imports -- only in this file we determine either we include as child of based of `newNextLinkBehavior` value import NextLink from 'next/link'; import React, { ComponentProps, ReactElement, forwardRef } from 'react'; type AnchorProps = Omit, 'ref'> & { newWindow?: boolean; }; export const Anchor = forwardRef( function Anchor( { href = '', children, newWindow, ...props }, // ref is used in forwardedRef ): ReactElement { if (newWindow) { return ( {children} ); } return ( <>{children} ); } );