From 55d0128e88b21948b310442dd8bbe34386e34e0b Mon Sep 17 00:00:00 2001 From: FarjadGov14 Date: Wed, 11 Dec 2024 15:32:14 -0500 Subject: [PATCH] fix toggle button lag Signed-off-by: FarjadGov14 --- packages/legacy/core/App/components/buttons/ToggleButton.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/legacy/core/App/components/buttons/ToggleButton.tsx b/packages/legacy/core/App/components/buttons/ToggleButton.tsx index 2dcf1def5c..88ee2e3287 100644 --- a/packages/legacy/core/App/components/buttons/ToggleButton.tsx +++ b/packages/legacy/core/App/components/buttons/ToggleButton.tsx @@ -28,7 +28,7 @@ const ToggleButton: React.FC = ({ useEffect(() => { Animated.timing(toggleAnim, { toValue: isEnabled ? 1 : 0, - duration: 200, + duration: 150, useNativeDriver: false, }).start() }, [isEnabled, toggleAnim]) @@ -88,4 +88,4 @@ const ToggleButton: React.FC = ({ ) } -export default ToggleButton +export default React.memo(ToggleButton);