MCPcopy Create free account
hub / github.com/api-platform/website / Link

Function Link

pwa/components/common/Link.tsx:9–20  ·  view source on GitHub ↗
({ href, prefetch = null, ...props }: any)

Source from the content-addressed store, hash-verified

7export type LinkProps = NextLinkProps;
8
9export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected