fixed dehydrate
This commit is contained in:
@@ -7,7 +7,7 @@ import "./globals.css"
|
|||||||
import Header from "@/components/layout/Header"
|
import Header from "@/components/layout/Header"
|
||||||
import MobileBottomNav from "@/components/layout/MobileBar"
|
import MobileBottomNav from "@/components/layout/MobileBar"
|
||||||
import { Toaster } from "@/components/ui/sonner"
|
import { Toaster } from "@/components/ui/sonner"
|
||||||
import { Providers } from "@/context/provider"
|
import { Providers } from "@/context/Provider"
|
||||||
import AuthWrapper from "@/context/AuthWrapper"
|
import AuthWrapper from "@/context/AuthWrapper"
|
||||||
|
|
||||||
const geistSans = Geist({
|
const geistSans = Geist({
|
||||||
|
|||||||
@@ -1,20 +1,22 @@
|
|||||||
"use client"
|
"use client";
|
||||||
|
|
||||||
import { QueryClientProvider, HydrationBoundary } from "@tanstack/react-query"
|
import {
|
||||||
import { queryClient } from "@/lib/queryClient"
|
QueryClientProvider,
|
||||||
import type { ReactNode } from "react"
|
HydrationBoundary,
|
||||||
|
type DehydratedState,
|
||||||
|
} from "@tanstack/react-query";
|
||||||
|
import { queryClient } from "@/lib/queryClient";
|
||||||
|
import type { ReactNode } from "react";
|
||||||
|
|
||||||
interface ProvidersProps {
|
interface ProvidersProps {
|
||||||
children: ReactNode
|
children: ReactNode;
|
||||||
dehydratedState?: unknown
|
dehydratedState?: DehydratedState;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Providers({ children, dehydratedState }: ProvidersProps) {
|
export function Providers({ children, dehydratedState }: ProvidersProps) {
|
||||||
return (
|
return (
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<HydrationBoundary state={dehydratedState}>
|
<HydrationBoundary state={dehydratedState}>{children}</HydrationBoundary>
|
||||||
{children}
|
|
||||||
</HydrationBoundary>
|
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user