Skip to content

Commit

Permalink
null check
Browse files Browse the repository at this point in the history
  • Loading branch information
computerjazz committed Feb 22, 2023
1 parent a98fc87 commit 1ac3d11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/DraggableFlatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,16 @@ function DraggableFlatListInner<T>(props: DraggableFlatListProps<T>) {
}
}
},
[isTouchActiveNative, onDragEnd]
[isTouchActiveNative, onDragEnd, onRelease]
);

useAnimatedReaction(
() => {
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]
Expand Down

0 comments on commit 1ac3d11

Please sign in to comment.