Skip to content

Commit 3c4f429

Browse files
committed
Fix usage of useDrawerStatus
1 parent 2832f1a commit 3c4f429

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

versioned_docs/version-6.x/drawer-based-navigation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ navigation.dispatch(DrawerActions.toggleDrawer());
9696
If you would like to determine if drawer is open or closed, you can do the following:
9797

9898
```js
99-
import { useIsDrawerOpen } from '@react-navigation/drawer';
99+
import { useDrawerStatus } from '@react-navigation/drawer';
100100

101101
// ...
102102

103-
const isDrawerOpen = useIsDrawerOpen();
103+
const isDrawerOpen = useDrawerStatus() === 'open';
104104
```

versioned_docs/version-6.x/drawer-navigator.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,14 +568,14 @@ function MyDrawer() {
568568

569569
## Checking if the drawer is open
570570

571-
You can check if the drawer is open by using the `useIsDrawerOpen` hook.
571+
You can check if the drawer is open by using the `useDrawerStatus` hook.
572572

573573
```js
574-
import { useIsDrawerOpen } from '@react-navigation/drawer';
574+
import { useDrawerStatus } from '@react-navigation/drawer';
575575

576576
// ...
577577

578-
const isDrawerOpen = useIsDrawerOpen();
578+
const isDrawerOpen = useDrawerStatus() === 'open';
579579
```
580580

581581
## Nesting drawer navigators inside others

0 commit comments

Comments
 (0)