From bdc5c2e9fb1a23c507fe0a0d30155fcb0fd5a239 Mon Sep 17 00:00:00 2001 From: Asad Umar Date: Sat, 5 Feb 2022 00:49:55 +0500 Subject: [PATCH] optimize useWindowSize --- ui/effects/use-screensize.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/ui/effects/use-screensize.js b/ui/effects/use-screensize.js index 080779096..3ed5fa509 100644 --- a/ui/effects/use-screensize.js +++ b/ui/effects/use-screensize.js @@ -21,8 +21,6 @@ export function useWindowSize(fn) { if (isWindowClient) { window.addEventListener('resize', setSize); - setSize(); - return () => window.removeEventListener('resize', setSize); } }, [fn, isWindowClient, setWindowSize, windowSize]);