Navigate using Link on Next-intl ?
Answered
West African Lion posted this in #help-forum
West African LionOP
Hey guys, im struggling on how to use the current language to navigate dynamiclay through my app.
Can't use ${pathname} on Link, any ideas ?
Can't use ${pathname} on Link, any ideas ?
``
import { useRouter, locales, localePrefix } from "../navigation";
import { useParams } from "next/navigation";
export default function Navigation() {
const params = useParams();
console.log(params);
console.log(locales);
console.log(localePrefix);
// const params = useParams();
// console.log(params);
return (
<>
<div className=" h-32 w-full flex lg:bg-white justify-between lg:justify-around bg-black lg:pr-12 overflow-y-hidden">
<div className="w-full h-full hidden lg:flex justify-evenly">
<div className="flex items-center w-5/12">
<div className="flex text-xl w-full justify-evenly font-light">
<Link href="/">
<span>Home</span>
</Link>
<Link href={`/${params}/services` }> // Here //
<span>Services</span>
</Link>
<Link href="/about">
<span>About</span>
</Link>
</div>
`