From 908f2b0b69bb8540f30501be570a0ec69c97559d Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sun, 21 Jun 2026 11:04:54 +0200 Subject: [PATCH] fix(lint): fix react-hooks/immutability error in InitialLoader --- components/providers/InitialLoader.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/providers/InitialLoader.tsx b/components/providers/InitialLoader.tsx index 4c7207061..70f0c1ff6 100644 --- a/components/providers/InitialLoader.tsx +++ b/components/providers/InitialLoader.tsx @@ -8,6 +8,12 @@ import Image from 'next/image'; export function InitialLoader({ shouldShowLoader = true }: { shouldShowLoader?: boolean }) { const [isLoading, setIsLoading] = useState(shouldShowLoader); + const finishLoading = () => { + // Set a session cookie so the server knows not to render the loader again + document.cookie = "etib_initial_loader_v5=true; path=/; samesite=lax"; + setIsLoading(false); + }; + useEffect(() => { if (!shouldShowLoader) return; @@ -21,12 +27,6 @@ export function InitialLoader({ shouldShowLoader = true }: { shouldShowLoader?: return () => clearTimeout(timeout); }, [shouldShowLoader]); - const finishLoading = () => { - // Set a session cookie so the server knows not to render the loader again - document.cookie = "etib_initial_loader_v5=true; path=/; samesite=lax"; - setIsLoading(false); - }; - // Wenn wir serverseitig rendern und es nicht zeigen sollen, return null if (!shouldShowLoader) return null;