diff --git a/src/hooks/useWindowSize.ts b/src/hooks/useWindowSize.ts index 547812bc..117bdb87 100644 --- a/src/hooks/useWindowSize.ts +++ b/src/hooks/useWindowSize.ts @@ -1,10 +1,13 @@ import { useState, useEffect } from 'react' export const useWindowSize = () => { - const [size, setSize] = useState({ width: 0, height: 0 }) + const [size, setSize] = useState({ + width: window.innerWidth, + height: window.innerHeight, + }) useEffect(() => { - function handleResize() { + const handleResize = () => { setSize({ width: window.innerWidth, height: window.innerHeight,