Hooks
useBottomSheetModal
โ
This hook provides modal functionalities only, for sheet functionalities please look at Bottom Sheet Hooks.
This hook works at any component in
BottomSheetModalProvider
.
import React from 'react';
import { View, Button } from 'react-native';
import { useBottomSheetModal } from '@gorhom/bottom-sheet';
const SheetContent = () => {
const { dismiss, dismissAll } = useBottomSheetModal();
return (
<View>
<Button onPress={dismiss}>
</View>
)
}
dismiss
โ
type dismiss = (key: string) => void;
Dismiss a modal by its name/key.
dismissAll
โ
type dismissAll = () => void;
Dismiss all mounted/presented modals.