mirror of
https://github.com/zhigang1992/react-native-bottom-sheet.git
synced 2026-06-15 10:27:55 +08:00
* chore: added docusaurus * chore: updated styling * docs: added current docs WIP * docs: added current docs WIP * docs: added current docs WIP * docs: updated custom handle & background docs * chore: update eslint * chore: updated website url * chore: updated library homepage url * chore: added google search console file * chore: added expo badge * docs: added troubleshooting page * docs: added faq page * chore: added backdrop prop * chore: added modal documents * chore: updated stack example * chore: added usage pages * fix: revert demo styling * fix: fixed features link on modal page * docs: updated root readme, and deleted old docs * docs: updated version 2 alpha 5 * fix: video player on mobile * chore: updated v2 alpha version * chore: compressed gifs * chore: updated video component * chore: updated custom handle, background & backdrop * chore: updated getting started page * docs: updated readme file
43 lines
719 B
Markdown
43 lines
719 B
Markdown
---
|
|
id: methods
|
|
title: Methods
|
|
slug: /modal/methods
|
|
hide_table_of_contents: true
|
|
---
|
|
|
|
|
|
**Bottom Sheet Modal** inherits all [**Bottom Sheet** methods](../methods) and also it introduces its own methods.
|
|
|
|
These methods are accessible using the bottom sheet modal reference:
|
|
|
|
```tsx
|
|
import {BottomSheetModal} from '@gorhom/bottom-sheet';
|
|
|
|
const App = () => {
|
|
const bottomSheetModalRef = useRef<BottomSheetModal>(null);
|
|
|
|
const present = () => bottomSheetModalRef.current.present()
|
|
|
|
return (
|
|
<BottomSheetModal ref={bottomSheetModalRef}>
|
|
)
|
|
}
|
|
|
|
```
|
|
|
|
### `present`
|
|
|
|
```ts
|
|
type present = () => void;
|
|
```
|
|
|
|
Mount and present the modal.
|
|
|
|
### `dismiss`
|
|
|
|
```ts
|
|
type dismiss = () => void;
|
|
```
|
|
|
|
Close and unmount the modal.
|