diff --git a/src/index.tsx b/src/index.tsx index aa17ee3..4475f63 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -261,7 +261,6 @@ function SwipeableItem( }); function onAnimationEnd(openDirection: OpenDirection, snapPoint: number) { - setOpenDirection(openDirection); onChange({ open: openDirection, snapPoint }); } @@ -311,6 +310,7 @@ function SwipeableItem( : closestSnapPoint > 0 ? OpenDirection.RIGHT : OpenDirection.LEFT; + runOnJS(setOpenDirection)(openDirection) runOnJS(onAnimationEnd)(openDirection, Math.abs(closestSnapPoint)); }; if (animStatePos.value === closestSnapPoint) onComplete();