Skip to content

Commit 65854cb

Browse files
palgorhythmyayvery
authored andcommitted
Pass snap points to JS thread when update is received on UI thread
1 parent 9a0fbe7 commit 65854cb

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
@@ -616,8 +616,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
616616
[_providedOnChange, animatedCurrentIndex]
617617
);
618618
const handleOnAnimate = useCallback(
619-
function handleOnAnimate(toPoint: number, source: ANIMATION_SOURCE) {
620-
const snapPoints = animatedSnapPoints.value;
619+
function handleOnAnimate(toPoint: number, source: ANIMATION_SOURCE, snapPoints: number[]) {
621620
const closedPosition = animatedClosedPosition.value;
622621
const toIndex =
623622
toPoint === closedPosition ? -1 : snapPoints.indexOf(toPoint);
@@ -721,7 +720,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
721720
/**
722721
* fire `onAnimate` callback
723722
*/
724-
runOnJS(handleOnAnimate)(position, source);
723+
runOnJS(handleOnAnimate)(position, source, animatedSnapPoints.value);
725724

726725
/**
727726
* force animation configs from parameters, if provided

0 commit comments

Comments
 (0)