From 2c7b763144bebf4c95b4d181d568a337da1d0ec7 Mon Sep 17 00:00:00 2001 From: Mo Gorhom Date: Tue, 9 Mar 2021 20:23:21 +0000 Subject: [PATCH] fix: prevent crash when set index -1 with animateOnMount --- src/components/bottomSheet/BottomSheet.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/bottomSheet/BottomSheet.tsx b/src/components/bottomSheet/BottomSheet.tsx index 03622c589..673451787 100644 --- a/src/components/bottomSheet/BottomSheet.tsx +++ b/src/components/bottomSheet/BottomSheet.tsx @@ -498,7 +498,8 @@ const BottomSheetComponent = forwardRef( animateOnMount && isLayoutCalculated && didMountOnAnimate.current === false && - isClosing.current === false + isClosing.current === false && + _providedIndex !== -1 ) { manualSnapToPoint.setValue(snapPoints[_providedIndex]); didMountOnAnimate.current = true;