diff --git a/src/app/components/About.tsx b/src/app/components/About.tsx index 3e624c5..144966b 100644 --- a/src/app/components/About.tsx +++ b/src/app/components/About.tsx @@ -36,11 +36,18 @@ const useContainerSize = (ref: React.RefObject) => { const useWindowSize = () => { const [windowSize, setWindowSize] = useState({ - width: window.innerWidth, - height: window.innerHeight, + width: 0, + height: 0, }); useEffect(() => { + // Initial window size. This is done here instead of in the useState + // declaration because the window object is not available on the server. + setWindowSize({ + width: window.innerWidth, + height: window.innerHeight, + }); + const handleResize = () => { setWindowSize({ width: window.innerWidth,