Skip to content

Commit e7a8508

Browse files
palgorhythmyayvery
authored andcommitted
Pass snap points to JS thread when update is received on UI thread
1 parent e4f07f2 commit e7a8508

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/bottomSheet/BottomSheet.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,7 @@ const BottomSheetComponent = forwardRef<BottomSheetMethods, BottomSheetProps>(
662662
[_providedOnChange, animatedCurrentIndex, animatedDynamicSnapPointIndex]
663663
);
664664
const handleOnAnimate = useCallback(
665-
function handleOnAnimate(toPoint: number, source: ANIMATION_SOURCE) {
666-
const snapPoints = animatedSnapPoints.value;
665+
function handleOnAnimate(toPoint: number, source: ANIMATION_SOURCE, snapPoints: number[]) {
667666
const closedPosition = animatedClosedPosition.value;
668667
const toIndex =
669668
toPoint === closedPosition ? -1 : snapPoints.indexOf(toPoint);
@@ -767,7 +766,7 @@ const BottomSheetComponent = forwardRef<BottomSheetMethods, BottomSheetProps>(
767766
/**
768767
* fire `onAnimate` callback
769768
*/
770-
runOnJS(handleOnAnimate)(position, source);
769+
runOnJS(handleOnAnimate)(position, source, animatedSnapPoints.value);
771770

772771
/**
773772
* start animation

0 commit comments

Comments
 (0)