Skip to content

Commit

Permalink
Support mailto when integrating with latest version of tanstack router
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Mar 3, 2024
1 parent e03f230 commit f61e054
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ type HTMLAnchorProps = DetailedHTMLProps<
export interface RegisterLink {}

export type RegisteredLinkProps = RegisterLink extends { Link: infer Link }
? Omit<UnpackProps<Link>, "children">
?
| Omit<UnpackProps<Link>, "children">
| (Omit<HTMLAnchorProps, "children" | "href"> & {
href:
| `mailto:${string}`
| `//${string}`
| `https://${string}`
| `http://${string}`
| `#${string}`;
})
: Omit<HTMLAnchorProps, "children">;

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

0 comments on commit f61e054

Please sign in to comment.