Files
web/hooks/useLang.ts
Niclas Edenvin e67212bd94 Merged in feature/refactor-lang (pull request #387)
feat: SW-238 Avoid prop drilling of lang

Approved-by: Michael Zetterberg
2024-08-14 11:00:20 +00:00

13 lines
253 B
TypeScript

"use client"
import { useParams } from "next/navigation"
import { LangParams } from "@/types/params"
/**
* A hook to get the current lang from the URL
*/
export default function useLang() {
const { lang } = useParams<LangParams>()
return lang
}