Open this example in the interactive library
Source code
"use client";
// components/RouteSpecificSupportLink.tsx
import Link from "next/link";
import { usePathname } from "next/navigation";
export default function RouteSpecificSupportLink({
href = "/studio",
label = "Studio",
}: { href?: string; label?: string } = {}) {
const path = usePathname();
return (
<Link href={{ pathname: "/support", query: { from: path } }}>
Help with {label}
</Link>
);
}
