Skip to content

Commit f61e054

Browse files
committed
Support mailto when integrating with latest version of tanstack router
1 parent e03f230 commit f61e054

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/link.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,16 @@ type HTMLAnchorProps = DetailedHTMLProps<
1414
export interface RegisterLink {}
1515

1616
export type RegisteredLinkProps = RegisterLink extends { Link: infer Link }
17-
? Omit<UnpackProps<Link>, "children">
17+
?
18+
| Omit<UnpackProps<Link>, "children">
19+
| (Omit<HTMLAnchorProps, "children" | "href"> & {
20+
href:
21+
| `mailto:${string}`
22+
| `//${string}`
23+
| `https://${string}`
24+
| `http://${string}`
25+
| `#${string}`;
26+
})
1827
: Omit<HTMLAnchorProps, "children">;
1928

2029
let Link: React.ComponentType<RegisteredLinkProps & { children: ReactNode }> = props => {

0 commit comments

Comments
 (0)