Fix hydration - check typeof window

This commit is contained in:
Manohar Gupta 2026-05-17 11:22:43 +05:30
parent 4212c1f632
commit 6247bb42bc

View file

@ -49,6 +49,10 @@ export function FamilyProvider({ children: providerChildren }: { children: React
const [memberCount, setMemberCount] = useState(2);
useEffect(() => {
if (typeof window === "undefined") {
setLoading(false);
return;
}
const path = window.location.pathname;
console.log("FamilyProvider: checking path =", path);
if (path.startsWith("/admin") || path === "/admin-login") {