Skip to content

Commit

Permalink
fix: prevent crash when set index -1 with animateOnMount
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Mar 9, 2021
1 parent 443672b commit 2c7b763
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
animateOnMount &&
isLayoutCalculated &&
didMountOnAnimate.current === false &&
isClosing.current === false
isClosing.current === false &&
_providedIndex !== -1
) {
manualSnapToPoint.setValue(snapPoints[_providedIndex]);
didMountOnAnimate.current = true;
Expand Down

0 comments on commit 2c7b763

Please sign in to comment.