Skip to content

Commit c444fd9

Browse files
committed
fix: Rendering with versioned link
1 parent f99d9c7 commit c444fd9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/link/versioned-link.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ import type { ComponentProps } from "react";
1010
*
1111
* Example:
1212
* - User on: /relayer/1.1.x/configuration
13-
* - Clicks link to: /relayer/signers
13+
* - Clicks: /relayer/signers
1414
* - Navigates to: /relayer/1.1.x/signers (version preserved)
1515
*/
1616
export function VersionedLink({ href, ...props }: ComponentProps<typeof Link>) {
1717
const pathname = usePathname();
1818

19+
// If pathname is not available, render regular Link
20+
if (!pathname) {
21+
return <Link href={href} {...props} />;
22+
}
23+
1924
// Only process string hrefs (not objects or undefined)
2025
if (typeof href !== "string") {
2126
return <Link href={href} {...props} />;

0 commit comments

Comments
 (0)