From fd05d0d60954e835566fda73594e0214c482a030 Mon Sep 17 00:00:00 2001 From: Petri Partio Date: Fri, 31 May 2024 14:18:39 +0300 Subject: [PATCH] fix: use a fixed brightness value in ssr --- components/TopFade.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/TopFade.tsx b/components/TopFade.tsx index bbf5538..ec35bdc 100644 --- a/components/TopFade.tsx +++ b/components/TopFade.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from 'react'; const calculatedBrightnessValue = () => { + if (typeof window === 'undefined') return 1; if (window.scrollY > 200) return 0.5; const amountToDecrease = (window.scrollY / 200) * 0.5; return 1 - amountToDecrease;