From 2680a4ed9c130cbfe6538b2f1b3de25c2e6265ae Mon Sep 17 00:00:00 2001 From: Deramecourt Mathurin Date: Tue, 12 Apr 2022 16:42:47 +0200 Subject: [PATCH] chore: removed unreachable return statement in hooks --- src/hooks.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/hooks.tsx b/src/hooks.tsx index 80c6a4f..54624b0 100644 --- a/src/hooks.tsx +++ b/src/hooks.tsx @@ -13,7 +13,6 @@ export const useOnEscape = ( document.addEventListener('keyup', listener); return () => { - if (!active) return; document.removeEventListener('keyup', listener); }; }, [handler, active]); @@ -29,7 +28,6 @@ export const useRepositionOnResize = (handler: () => void, active = true) => { window.addEventListener('resize', listener); return () => { - if (!active) return; window.removeEventListener('resize', listener); }; }, [handler, active]); @@ -61,7 +59,6 @@ export const useOnClickOutside = ( document.addEventListener('touchstart', listener); return () => { - if (!active) return; document.removeEventListener('mousedown', listener); document.removeEventListener('touchstart', listener); }; @@ -103,7 +100,6 @@ export const useTabbing = ( document.addEventListener('keydown', listener); return () => { - if (!active) return; document.removeEventListener('keydown', listener); }; }, [contentRef, active]);