({ href, prefetch = null, ...props }: any)
| 7 | export type LinkProps = NextLinkProps; |
| 8 | |
| 9 | export default function Link({ href, prefetch = null, ...props }: any) { |
| 10 | const router = useRouter(); |
| 11 | const goToUrl = (e: MouseEvent) => { |
| 12 | router.push(href); |
| 13 | e.preventDefault(); |
| 14 | }; |
| 15 | const prefetchFalse = prefetch === false && props.target !== "_blank"; |
| 16 | if (prefetchFalse) { |
| 17 | return <a href={href} onClick={goToUrl} {...props} />; |
| 18 | } |
| 19 | return <NextLink href={href} {...props} />; |
| 20 | } |
nothing calls this directly
no outgoing calls
no test coverage detected