usePathname()

현재 path를 가져오는 훅. browser API로 클라이언트 컴포넌트에서만 사용 가능하다.

import { usePathname } from "next/navigation";

const currentPath = usePathname();