We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95b6379 commit a0fcf1dCopy full SHA for a0fcf1d
src/providers/providers.tsx
@@ -2,8 +2,19 @@
2
3
import { ThemeProvider } from "@/providers/theme-provider";
4
import ReactQueryProvider from "@/providers/react-query-provider";
5
+import { useState, useEffect } from "react";
6
7
export function Providers({ children }: { children: React.ReactNode }) {
8
+ const [mounted, setMounted] = useState(false);
9
+
10
+ useEffect(() => {
11
+ setMounted(true);
12
+ }, []);
13
14
+ if (!mounted) {
15
+ return <>{children}</>; // Render children without ThemeProvider during SSR
16
+ }
17
18
return (
19
<ThemeProvider
20
attribute="class"
0 commit comments