xxxxxxxxxx
npm i react-native-raw-bottom-sheet --save
xxxxxxxxxx
import React, { useRef } from "react";
import { View, Button } from "react-native";
import RBSheet from "react-native-raw-bottom-sheet";
export default function Example() {
const refRBSheet = useRef();
return (
<View
style={{
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#000"
}}
>
<Button title="OPEN BOTTOM SHEET" onPress={() => refRBSheet.current.open()} />
<RBSheet
ref={refRBSheet}
closeOnDragDown={true}
closeOnPressMask={false}
customStyles={{
wrapper: {
backgroundColor: "transparent"
},
draggableIcon: {
backgroundColor: "#000"
}
}}
>
<YourOwnComponent />
</RBSheet>
</View>
);
}
xxxxxxxxxx
//you will need to use BottomSheetModal and add its provider to the root component of you application
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet'
const App = () => {
return (
<BottomSheetModalProvider>
<Navigation /> // this is my app entry component (react-navigation Navigator), use yours
</BottomSheetModalProvider>
)