From 4de86d5b08f9bc1d960b51746260a5b8c5d9b1fd Mon Sep 17 00:00:00 2001 From: Milli Date: Tue, 31 May 2022 17:43:21 +0200 Subject: [PATCH] refactoring --- web/hooks/use-measure-size.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/hooks/use-measure-size.ts b/web/hooks/use-measure-size.ts index 6959e241..723c2fe4 100644 --- a/web/hooks/use-measure-size.ts +++ b/web/hooks/use-measure-size.ts @@ -16,7 +16,7 @@ export function useListenElemSize( debounceMs: number | undefined = undefined ) { const handleResize = useMemo(() => { - let updateSize = () => { + const updateSize = () => { if (elemRef.current) callback(getSize(elemRef.current)) } @@ -25,7 +25,7 @@ export function useListenElemSize( : updateSize }, [callback, elemRef, debounceMs]) - let elem = elemRef.current + const elem = elemRef.current useLayoutEffect(() => { if (!elemRef.current) return