react-native-bottom-sheet: [Bug]: BottomSheetModal won't show up in EXPO SDK 52
Version
v5
Reanimated Version
v3
Gesture Handler Version
v2
Platforms
iOS, Android
What happened?
I have a pressable button to open the bottomsheetmodal, and when I use the SDK 51, it works perfectly. So, the onPress function fires the bottomsheetRef.current.present() method, and the bottom sheet modal gonna show up to the snapPoints.
But yesterday I started to upgrade to expo SDK 52 and then update all the libraries to its latest version base on what expo-doctor ordered me to install.
And when I already finished upgrading the expo sdk, react native, and all libraries version, then I start and test the bottomsheetmodal if its still workin. But it doesn’t show up anything, and when I checked using console.log, it gave me undefined for the bottomsheetRef.current.present() method. And the reanimated always gave me warnings about the value from bottom sheet everytime it got re-rendered on the screen.
I can’t even open the bottommodalsheet on sdk 52 in this snack below that I got from ur sample code template: https://snack.expo.dev/@gorhom/bottom-sheet---issue-reproduction-template
You can check the codes in Reproduction sample below.
Reproduction steps
Reproduction sample
https://snack.expo.dev/@princesp/test-maps
Relevant log output
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 21
- Comments: 26 (1 by maintainers)
enableDynamicSizing={false}
May have fixed it for me
it should be fixed with the latest release, thanks for reporting it
I recommend following this great tutorial to build a BottomSheet from Scratch.
https://www.youtube.com/watch?v=KvRqsRwpwhY
Ok for those who have an issue i have a fix for you.
Just add a BottomSheetView component from the same library inside the BottomSheetModal
If you ask me why we need to add this with Expo 52 and not in expo 51 so go figure…cause i don’t know
Same bug
This worked for me as well. Made no other change. Thanks man.
Same issue here in SDK 52 and version 5.0.5, looks like adding
BottomSheetViewinsideBottomSheetModalwork.But I tried with
BottomSheetScrollViewinsideBottomSheetModaland it don’t want to show uplol it just randomly started working. i made an update to an animated view on the same page where the bottom sheet is rendered. react native 0.76 changed the way they deal with animated views so i suppose fixing that somehow played a role i in fixing the issue with my bottom sheet? not sure but that’s the only thing i changed that made the bottom sheet start working properly without changing any of the code in the bottom sheet
Update: yes it was completely random because now it randomly stopped working again. man, this upgrade to Expo SDK 52 is gonna be fun…
I felt that since there’s still reports here that this issue is still occurring (and I’m able to reproduce in Expo Snack) I thought that we’d best re-open it 🙏 https://github.com/gorhom/react-native-bottom-sheet/issues/2126
It worked for me as well!
Any reason why this is the case?
I am still struggling with this after upgrading to 5.0.6 for bottom sheet.
when i press a button to open my bottom sheet, the sheet doesn’t pull up at all and there’s only a white sliver at the bottom of my screen that i have to carefully press and pull up to get it to open all the way to the top snap point. but the opacity layer that darkens the screen behind the sheet does show up like normal.
After upgrading to your latest release, I noticed that nothing has changed. Moreover, since Expo 52, your BottomSheet is not working as well as before.
Take a look at this simple component that was working perfectly before Expo 52, but now it doesn’t open :
import React, { useCallback } from “react”; import { View, Text, Dimensions } from “react-native”; import { BottomSheetModal, useBottomSheetSpringConfigs, BottomSheetBackdrop, } from “@gorhom/bottom-sheet”; import LinearGradientButton from “@/components/GradientButton”;
const BottomSheetConfirmation = ({ refBottomSheet, snapPoints, isVisible, onDismiss, bottomSheetTitle, onPressCancel, iconNameCancel, cancelText, onPressConfirm, iconNameConfirm, confirmText, }) => { const animationConfigs = useBottomSheetSpringConfigs({ damping: 50, overshootClamping: false, restDisplacementThreshold: 100, restSpeedThreshold: 100, stiffness: 700, });
const renderBackdrop = useCallback( (props) => ( <BottomSheetBackdrop {…props} appearsOnIndex={1} pressBehavior=“close” animatedIndex={{ value: 0.5, }} style={{ position: ‘absolute’, width: Dimensions.get(‘window’).width, height: Dimensions.get(‘window’).height, top: -100, }} /> ), [] );
return ( <BottomSheetModal ref={refBottomSheet} snapPoints={snapPoints} backdropComponent={renderBackdrop} index={isVisible ? 0 : -1} animationConfigs={animationConfigs} backgroundStyle={{ borderRadius: 20, shadowColor: “#000”, shadowOffset: { width: 0, height: 3 }, shadowOpacity: 0.27, shadowRadius: 4.65, elevation: 6, }} onDismiss={onDismiss} > <View style={{ backgroundColor: “#fff”, justifyContent: “center”, alignItems: “center”, padding: 10, marginBottom: 30, }} > <Text style={{ fontSize: 20, fontFamily: “sg-m”, textAlign: “center”, }} > {bottomSheetTitle} </Text>
); };
export default BottomSheetConfirmation;
Thank you so much for your attention on this issue @gorhom ✨🥳