Buckets:
| import React, { ReactElement, AnchorHTMLAttributes } from "react"; | |
| import Link, { LinkProps } from "next/link"; | |
| export interface LinkUnstyledProps | |
| extends Omit<LinkProps, "children" | "onError">, | |
| Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "onError" | "href"> {} | |
| export default function LinkUnstyled({ | |
| as, | |
| href, | |
| scroll, | |
| shallow, | |
| replace, | |
| children, | |
| ...props | |
| }: LinkUnstyledProps): ReactElement { | |
| if (typeof href === "string" && href.startsWith("http")) { | |
| // external links | |
| return ( | |
| <a {...props} href={href} rel="noopener noreferrer"> | |
| {children} | |
| </a> | |
| ); | |
| } | |
| return ( | |
| <Link | |
| shallow={shallow} | |
| scroll={scroll} | |
| replace={replace} | |
| href={href} | |
| as={as} | |
| {...props} | |
| > | |
| {children} | |
| </Link> | |
| ); | |
| } | |
Xet Storage Details
- Size:
- 798 Bytes
- Xet hash:
- 9cc4aa867f2278867e466340e6c4ef7a842f287b66ccd1c923915f94bce86d40
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.