diff --git a/src/components/ReanimatedSwipeable.tsx b/src/components/ReanimatedSwipeable.tsx index f7e3a190f1..c6cc25a983 100644 --- a/src/components/ReanimatedSwipeable.tsx +++ b/src/components/ReanimatedSwipeable.tsx @@ -18,7 +18,6 @@ import { import type { PanGestureHandlerProps } from '../handlers/PanGestureHandler'; import type { PanGestureHandlerEventPayload } from '../handlers/GestureHandlerEventPayload'; import Animated, { - Extrapolation, SharedValue, interpolate, runOnJS, @@ -232,9 +231,6 @@ const Swipeable = forwardRef( const rightWidth = useSharedValue(0); const rightOffset = useSharedValue(null); - const leftActionTranslate = useSharedValue(0); - const rightActionTranslate = useSharedValue(0); - const showLeftProgress = useSharedValue(0); const showRightProgress = useSharedValue(0); @@ -325,12 +321,7 @@ const Swipeable = forwardRef( [0, 0, 1] ) : 0; - leftActionTranslate.value = interpolate( - showLeftProgress.value, - [0, Number.MIN_VALUE], - [-10000, 0], - Extrapolation.CLAMP - ); + showRightProgress.value = rightWidth.value > 0 ? interpolate( @@ -339,12 +330,6 @@ const Swipeable = forwardRef( [1, 0, 0] ) : 0; - rightActionTranslate.value = interpolate( - showRightProgress.value, - [0, Number.MIN_VALUE], - [-10000, 0], - Extrapolation.CLAMP - ); }; const dispatchImmediateEvents = useCallback( @@ -466,19 +451,8 @@ const Swipeable = forwardRef( }, }; - const leftAnimatedStyle = useAnimatedStyle( - () => ({ - transform: [ - { - translateX: leftActionTranslate.value, - }, - ], - }), - [leftActionTranslate] - ); - const leftElement = renderLeftActions && ( - + {renderLeftActions( showLeftProgress, appliedTranslation, @@ -492,19 +466,8 @@ const Swipeable = forwardRef( ); - const rightAnimatedStyle = useAnimatedStyle( - () => ({ - transform: [ - { - translateX: rightActionTranslate.value, - }, - ], - }), - [rightActionTranslate] - ); - const rightElement = renderRightActions && ( - + {renderRightActions( showRightProgress, appliedTranslation,