Noobkun
Noobkun
TTCTheo's Typesafe Cult
Created by Noobkun on 6/3/2023 in #questions
Strange network activity in devtools
Basically refetchOnWindowFocus was set to true (https://tanstack.com/query/v4/docs/react/guides/window-focus-refetching)
5 replies
TTCTheo's Typesafe Cult
Created by Noobkun on 6/3/2023 in #questions
Strange network activity in devtools
Found the culprit, it was react-query
5 replies
TTCTheo's Typesafe Cult
Created by niels on 6/3/2023 in #questions
getServerAuthSession at any place crashes my app. 5000+ errors per second!
I'm new too ^^' sorry if it wasn't helpfull
16 replies
TTCTheo's Typesafe Cult
Created by niels on 6/3/2023 in #questions
getServerAuthSession at any place crashes my app. 5000+ errors per second!
const SidebarMobile = ({ session }) => {
return session && session.user ? (
<Sheet>
{/* ... */}
</Sheet>
) : null;
};

// Usage in your code
const MyComponent = () => {
const [session, setSession] = useState(null);

useEffect(() => {
const fetchSession = async () => {
const session = await getServerAuthSession();
setSession(session);
};

fetchSession();
}, []);

return (
<div>
{/* ... */}
<SidebarMobile session={session} />
{/* ... */}
</div>
);
};
const SidebarMobile = ({ session }) => {
return session && session.user ? (
<Sheet>
{/* ... */}
</Sheet>
) : null;
};

// Usage in your code
const MyComponent = () => {
const [session, setSession] = useState(null);

useEffect(() => {
const fetchSession = async () => {
const session = await getServerAuthSession();
setSession(session);
};

fetchSession();
}, []);

return (
<div>
{/* ... */}
<SidebarMobile session={session} />
{/* ... */}
</div>
);
};
16 replies