Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions packages/react-router/src/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,7 @@ export class Route<

Link: LinkComponent<'a', TFullPath> = React.forwardRef(
(props, ref: React.ForwardedRef<HTMLAnchorElement>) => {
const router = useRouter()
return (
<Link
ref={ref}
from={router.routesById[this.id].fullPath as never}
{...props}
/>
)
return <Link ref={ref} from={this.fullPath as never} {...props} />
},
) as unknown as LinkComponent<'a', TFullPath>
}
Expand Down Expand Up @@ -455,14 +448,7 @@ export class RootRoute<

Link: LinkComponent<'a', '/'> = React.forwardRef(
(props, ref: React.ForwardedRef<HTMLAnchorElement>) => {
const router = useRouter()
return (
<Link
ref={ref}
from={router.routesById[this.id].fullPath as never}
{...props}
/>
)
return <Link ref={ref} from={this.fullPath} {...props} />
},
) as unknown as LinkComponent<'a', '/'>
}
Expand Down
8 changes: 2 additions & 6 deletions packages/solid-router/src/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,7 @@ export class Route<
}

Link: LinkComponent<'a', TFullPath> = (props) => {
const router = useRouter()
const fullPath = router.routesById[this.id as string].fullPath
return <Link from={fullPath as never} {...props} />
return <Link from={this.fullPath} {...props} />
}
}

Expand Down Expand Up @@ -430,9 +428,7 @@ export class RootRoute<
}

Link: LinkComponent<'a', '/'> = (props) => {
const router = useRouter()
const fullPath = router.routesById[this.id as string].fullPath
return <Link from={fullPath as never} {...props} />
return <Link from={this.fullPath} {...props} />
}
}

Expand Down