MCPcopy
hub / github.com/TanStack/router / createLink

Function createLink

packages/react-router/src/link.tsx:901–907  ·  view source on GitHub ↗
(
  Comp: Constrain<TComp, any, (props: CreateLinkProps) => ReactNode>,
)

Source from the content-addressed store, hash-verified

899 * @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-link
900 */
901export function createLink<const TComp>(
902 Comp: Constrain<TComp, any, (props: CreateLinkProps) => ReactNode>,
903): LinkComponent<TComp> {
904 return React.forwardRef(function CreatedLink(props, ref) {
905 return <Link {...(props as any)} _asChild={Comp} ref={ref} />
906 }) as any
907}
908
909/**
910 * A strongly-typed anchor component for declarative navigation.

Callers 6

link.test-d.tsxFile · 0.90
link.test.tsxFile · 0.90
CustomLink.tsxFile · 0.90
RootComponentFunction · 0.90
RootComponentFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected