Skip to content

Commit 9b55d63

Browse files
committed
Update drawer docs for defaultStatus
1 parent ce11346 commit 9b55d63

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ It supports the following values:
6565
- `history` - return to last visited tab
6666
- `none` - do not handle back button
6767

68-
#### `openByDefault`
68+
#### `defaultStatus`
6969

70-
Whether the drawer should stay open by default. When this is `true`, the drawer will be open from the initial render. It can be closed normally using gestures or programmatically. However, when going back, drawer will re-open if it was closed. This essentially reverses the behavior of the drawer where the closed state is the default state.
70+
The default status of the drawer - whether the drawer should stay `open` or `closed` by default.
71+
72+
When this is set to `open`, the drawer will be open from the initial render. It can be closed normally using gestures or programmatically. However, when going back, drawer will re-open if it was closed. This is essentially the opposite of the default behavior of the drawer where it starts `closed`, and back button closes an open drawer.
7173

7274
#### `detachInactiveScreens`
7375

@@ -306,7 +308,7 @@ function MyDrawer() {
306308
}
307309
```
308310

309-
You can also specify other props such as `drawerStyle` based on screen size to customize the behavior. For example, you can combine it with `openByDefault` to achieve a master-detail layout:
311+
You can also specify other props such as `drawerStyle` based on screen size to customize the behavior. For example, you can combine it with `defaultStatus="open"` to achieve a master-detail layout:
310312

311313
```js
312314
import { useWindowDimensions } from 'react-native';
@@ -321,7 +323,7 @@ function MyDrawer() {
321323

322324
return (
323325
<Drawer.Navigator
324-
openByDefault
326+
defaultStatus="open"
325327
screenOptions={{
326328
drawerType: isLargeScreen ? 'permanent' : 'back',
327329
drawerStyle: isLargeScreen ? null : { width: '100%' },

0 commit comments

Comments
 (0)