diff --git a/web/src/components/icon-grid.tsx b/web/src/components/icon-grid.tsx index 9485b1d6..7ae8ec53 100644 --- a/web/src/components/icon-grid.tsx +++ b/web/src/components/icon-grid.tsx @@ -21,9 +21,11 @@ export function IconsGrid({ filteredIcons, matchedAliases }: IconsGridProps) { export function VirtualizedIconsGrid({ filteredIcons, matchedAliases }: IconsGridProps) { const listRef = useRef(null) - const [windowWidth, setWindowWidth] = useState(typeof window !== "undefined" ? window.innerWidth : 1280) + const [windowWidth, setWindowWidth] = useState(0) useEffect(() => { + setWindowWidth(window.innerWidth) + const handleResize = () => { setWindowWidth(window.innerWidth) }