We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f99d9c7 commit c444fd9Copy full SHA for c444fd9
1 file changed
src/components/link/versioned-link.tsx
@@ -10,12 +10,17 @@ import type { ComponentProps } from "react";
10
*
11
* Example:
12
* - User on: /relayer/1.1.x/configuration
13
- * - Clicks link to: /relayer/signers
+ * - Clicks: /relayer/signers
14
* - Navigates to: /relayer/1.1.x/signers (version preserved)
15
*/
16
export function VersionedLink({ href, ...props }: ComponentProps<typeof Link>) {
17
const pathname = usePathname();
18
19
+ // If pathname is not available, render regular Link
20
+ if (!pathname) {
21
+ return <Link href={href} {...props} />;
22
+ }
23
+
24
// Only process string hrefs (not objects or undefined)
25
if (typeof href !== "string") {
26
return <Link href={href} {...props} />;
0 commit comments