diff --git a/src/components/DraggableFlatList.tsx b/src/components/DraggableFlatList.tsx index b092c2f7..d7d98c27 100644 --- a/src/components/DraggableFlatList.tsx +++ b/src/components/DraggableFlatList.tsx @@ -246,7 +246,7 @@ function DraggableFlatListInner(props: DraggableFlatListProps) { } } }, - [isTouchActiveNative, onDragEnd] + [isTouchActiveNative, onDragEnd, onRelease] ); useAnimatedReaction( @@ -254,8 +254,8 @@ function DraggableFlatListInner(props: DraggableFlatListProps) { return spacerIndexAnim.value; }, (cur, prev) => { - if (cur !== prev && cur >= 0 && prev >= 0) { - runOnJS(onPlaceholderIndexChange)(cur) + if (prev !== null && cur !== prev && cur >= 0 && prev >= 0) { + runOnJS(onPlaceholderIndexChange)(cur); } }, [spacerIndexAnim]