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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user