optimize useWindowSize
This commit is contained in:
parent
df320a2375
commit
bdc5c2e9fb
1 changed files with 0 additions and 2 deletions
|
@ -21,8 +21,6 @@ export function useWindowSize(fn) {
|
||||||
if (isWindowClient) {
|
if (isWindowClient) {
|
||||||
window.addEventListener('resize', setSize);
|
window.addEventListener('resize', setSize);
|
||||||
|
|
||||||
setSize();
|
|
||||||
|
|
||||||
return () => window.removeEventListener('resize', setSize);
|
return () => window.removeEventListener('resize', setSize);
|
||||||
}
|
}
|
||||||
}, [fn, isWindowClient, setWindowSize, windowSize]);
|
}, [fn, isWindowClient, setWindowSize, windowSize]);
|
||||||
|
|
Loading…
Reference in a new issue