Skip to content

Commit

Permalink
fix: rename component created by createLink
Browse files Browse the repository at this point in the history
because if it's named `Link`, the world explodes
  • Loading branch information
TkDodo committed Mar 26, 2024
1 parent 4972e94 commit 8769cc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-router/src/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ export type LinkProps<
| ((state: { isActive: boolean }) => React.ReactNode)
}
type LinkComponent<TComp> = <
export type LinkComponent<TComp> = <
TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],
TFrom extends RoutePaths<TRouteTree> | string = string,
TTo extends string = '',
Expand All @@ -652,7 +652,7 @@ type LinkComponent<TComp> = <
) => React.ReactElement
export function createLink<const TComp>(Comp: TComp): LinkComponent<TComp> {
return React.forwardRef(function Link(props, ref) {
return React.forwardRef(function CreatedLink(props, ref) {
return <Link {...(props as any)} _asChild={Comp} ref={ref} />
}) as any
}
Expand Down

0 comments on commit 8769cc8

Please sign in to comment.