From 063f5644779f37754608972507b10d0cfb87769a Mon Sep 17 00:00:00 2001 From: XunGong Date: Mon, 27 Dec 2021 14:07:09 +0800 Subject: [PATCH] fix: item blink --- src/ScrollViewGesture.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ScrollViewGesture.tsx b/src/ScrollViewGesture.tsx index f5e6f772..0fdb9d97 100644 --- a/src/ScrollViewGesture.tsx +++ b/src/ScrollViewGesture.tsx @@ -14,6 +14,7 @@ import Animated, { useSharedValue, withDecay, withSpring, + withTiming, } from 'react-native-reanimated'; type GestureContext = { @@ -183,7 +184,9 @@ const IScrollViewGesture: React.FC = (props) => { panTranslation = panTranslation * 0.5; } - translation.value = ctx.panOffset + panTranslation; + translation.value = withTiming(ctx.panOffset + panTranslation, { + duration: 0, + }); }, onEnd: (e) => { const { velocityX, velocityY, translationX, translationY } = e;