Skip to content

Commit

Permalink
docs: add custom link example for mantine (#3033)
Browse files Browse the repository at this point in the history
  • Loading branch information
youssefbenlemlih authored Dec 18, 2024
1 parent dbdd43a commit 8a09e26
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/framework/react/guide/custom-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,30 @@ export const CustomLink: LinkComponent<typeof MUILinkComponent> = (props) => {
return <CreatedLinkComponent preload={'intent'} {...props} />
}
```

### Mantine example

```tsx
import * as React from "react";
import { createLink, LinkComponent } from "@tanstack/react-router";
import { Anchor, AnchorProps } from "@mantine/core";

interface MantineAnchorProps extends Omit<AnchorProps, "href"> {
// Add any additional props you want to pass to the anchor
}

const MantineLinkComponent = React.forwardRef<
HTMLAnchorElement,
MantineAnchorProps
>((props, ref) => {
return <Anchor ref={ref} {...props} />;
});

const CreatedLinkComponent = createLink(MantineLinkComponent);

export const CustomLink: LinkComponent<typeof MantineLinkComponent> = (
props
) => {
return <CreatedLinkComponent preload="intent" {...props} />;
};
```

0 comments on commit 8a09e26

Please sign in to comment.