mirror of
				https://github.com/walkxcode/dashboard-icons.git
				synced 2025-10-31 08:47:57 +01:00 
			
		
		
		
	fix(icon-grid): Initialize windowWidth to 0
This commit is contained in:
		| @@ -21,9 +21,11 @@ export function IconsGrid({ filteredIcons, matchedAliases }: IconsGridProps) { | ||||
|  | ||||
| export function VirtualizedIconsGrid({ filteredIcons, matchedAliases }: IconsGridProps) { | ||||
| 	const listRef = useRef<HTMLDivElement | null>(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) | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user