Make sure the index prop is set to -1 so it stays hidden initially.
const bottomSheetRef = useRef<BottomSheet>(null);
<BottomSheet
ref={bottomSheetRef}
index={-1} // HIDDEN on mount
snapPoints={['25%', '50%']}
enablePanDownToClose={true}
>
{/* Content */}
</BottomSheet>
Trigger it explicitly from your button press:
const handleOpenSheet = () => {
bottomSheetRef.current?.snapToIndex(0); // Or use .expand() if you want full height
};
const handleOpenSheet = () => {
bottomSheetRef.current?.snapToIndex(0); // Or use .expand() if you want full height
};
Work with our skilled React Native developers to accelerate your project and boost its performance.
Hire React Native Developers