Merged in feature/refactor-lang (pull request #387)
feat: SW-238 Avoid prop drilling of lang Approved-by: Michael Zetterberg
This commit is contained in:
12
hooks/useLang.ts
Normal file
12
hooks/useLang.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
"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
|
||||
}
|
||||
Reference in New Issue
Block a user