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:
Niclas Edenvin
2024-08-14 11:00:20 +00:00
parent 35128dbf44
commit e67212bd94
94 changed files with 378 additions and 322 deletions

View File

@@ -14,9 +14,9 @@ import { env } from "@/env/client"
import { SessionExpiredError } from "@/server/errors/trpc"
import { transformer } from "@/server/transformer"
import { trpc } from "./client"
import useLang from "@/hooks/useLang"
import { LangParams } from "@/types/params"
import { trpc } from "./client"
function initializeTrpcClient() {
// Locally we set nextjs to run on port to 3000 so that we always guarantee
@@ -41,10 +41,8 @@ function initializeTrpcClient() {
})
}
export default function TrpcProvider({
children,
lang,
}: React.PropsWithChildren<LangParams>) {
export default function TrpcProvider({ children }: React.PropsWithChildren) {
const lang = useLang()
const [queryClient] = useState(
() =>
new QueryClient({