react-native-bottom-sheet
react-native-bottom-sheet copied to clipboard
Cant close bottomsheet
hi, I can't close the bottomsheet using the button I created, here is the code and link video. Is there any other way? video: https://drive.google.com/file/d/1tqYglGS4AKyYLESECVKWwJQV6Iv8m4Eu/view?usp=sharing
code:
export const Test = () => {
const bottomSheet = useRef<BottomSheetMethods>(null);
return (
<GestureHandlerRootView
style={{
flex: 1,
backgroundColor: '#fff',
}}>
<TouchableOpacity onPress={() => bottomSheet.current?.open()}>
<Text>open bottomsheet</Text>
</TouchableOpacity>
<BottomSheet ref={bottomSheet} height={500}>
<View>
<TouchableOpacity
style={{
width: 200,
height: 200,
}}
onPress={() => {
console.log('close');
bottomSheet.current?.close();
}}>
<Text>close bottomsheet</Text>
</TouchableOpacity>
</View>
</BottomSheet>
</GestureHandlerRootView>
);
};
No, what you have should work fine. I'll do a quick repro soon to check it out.
Thanks for reporting @Madeean also can you check if dragging the sheet down closes it
it's normal when you click out of bottomsheet or drag down the bottomsheet
i use this version "react": "18.3.1", "react-native": "0.76.5",
when I enable newArchEnabled in gradle.properties, it happens, but when I disable it, it runs normally.