diff --git a/src/components/bottomSheetModalProvider/BottomSheetModalProvider.tsx b/src/components/bottomSheetModalProvider/BottomSheetModalProvider.tsx index b8c8b924..f0412c55 100644 --- a/src/components/bottomSheetModalProvider/BottomSheetModalProvider.tsx +++ b/src/components/bottomSheetModalProvider/BottomSheetModalProvider.tsx @@ -102,8 +102,10 @@ const BottomSheetModalProviderWrapper = ({ * Here we remove the unmounted sheet and update * the sheets queue. */ - _sheetsQueue.splice(sheetIndex, 1); - sheetsQueueRef.current = _sheetsQueue; + if (sheetIndex !== -1) { + _sheetsQueue.splice(sheetIndex, 1); + sheetsQueueRef.current = _sheetsQueue; + } /** * Here we try to restore previous sheet position if unmounted