fix: prevent crash when set index -1 with animateOnMount

This commit is contained in:
Mo Gorhom
2021-03-09 20:23:21 +00:00
parent 443672bf8e
commit 2c7b763144

View File

@@ -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;