You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You also need to install [`react-native-gesture-handler`](https://docs.swmansion.com/react-native-gesture-handler/) and [`react-native-reanimated`](https://docs.swmansion.com/react-native-reanimated/).
24
24
25
-
If you have a Expo managed project, in your project directory, run:
25
+
If you have an Expo managed project, in your project directory, run:
@@ -73,15 +73,15 @@ The `Drawer.Navigator` component accepts following props:
73
73
74
74
#### `initialRouteName`
75
75
76
-
The name of the route to render on first load of the navigator.
76
+
The name of the route to render on the first load of the navigator.
77
77
78
78
#### `screenOptions`
79
79
80
80
Default options to use for the screens in the navigator.
81
81
82
82
#### `backBehavior`
83
83
84
-
This controls how going back in the navigator is handled. This includes when the back button is pressed/back gesture is performed, or `goBack` is called.
84
+
This controls how going back in the navigator is handled. This includes when the back button is pressed, back gesture is performed, or `goBack` is called.
85
85
86
86
It supports the following values:
87
87
@@ -95,7 +95,7 @@ It supports the following values:
95
95
96
96
The default status of the drawer - whether the drawer should stay `open` or `closed` by default.
97
97
98
-
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.
98
+
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, the 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 the back button closes an open drawer.
99
99
100
100
#### `detachInactiveScreens`
101
101
@@ -107,7 +107,7 @@ Whether the screens should render the first time they are accessed. Defaults to
107
107
108
108
Whether to use the legacy implementation based on Reanimated 1. The new implementation based on Reanimated 2 will perform better, but you need additional configuration and need to use Hermes with Flipper to debug.
109
109
110
-
This defaults to `true` in following cases:
110
+
This defaults to `true` in the following cases:
111
111
112
112
- Reanimated 2 is not configured
113
113
- App is connected to Chrome debugger (Reanimated 2 cannot be used with Chrome debugger)
@@ -119,7 +119,7 @@ Otherwise, it defaults to `false`
119
119
120
120
Function that returns React element to render as the content of the drawer, for example, navigation items
121
121
122
-
The content component receives following props by default:
122
+
The content component receives the following props by default:
123
123
124
124
-`state` - The [navigation state](navigation-state.md) of the navigator.
125
125
-`navigation` - The navigation object for the navigator.
@@ -130,7 +130,7 @@ The content component receives following props by default:
130
130
131
131
The default component for the drawer is scrollable and only contains links for the routes in the RouteConfig. You can easily override the default component to add a header, footer, or other content to the drawer. The default content component is exported as `DrawerContent`. It renders a `DrawerItemList` component inside a `ScrollView`.
132
132
133
-
By default the drawer is scrollable and supports devices with notches. If you customize the content, you can use `DrawerContentScrollView` to handle this automatically:
133
+
By default, the drawer is scrollable and supports devices with notches. If you customize the content, you can use `DrawerContentScrollView` to handle this automatically:
134
134
135
135
```js
136
136
import {
@@ -231,7 +231,7 @@ The following [options](screen-options.md) can be used to configure the screens
231
231
232
232
#### `title`
233
233
234
-
Generic title that can be used as a fallback for `headerTitle` and `drawerLabel`.
234
+
A generic title that can be used as a fallback for `headerTitle` and `drawerLabel`.
235
235
236
236
#### `lazy`
237
237
@@ -304,7 +304,7 @@ Options are `left` or `right`. Defaults to `left` for LTR languages and `right`
304
304
305
305
Type of the drawer. It determines how the drawer looks and animates.
306
306
307
-
-`front`: Traditional drawer which covers the screen with a overlay behind it.
307
+
-`front`: Traditional drawer which covers the screen with an overlay behind it.
308
308
-`back`: The drawer is revealed behind the screen on swipe.
309
309
-`slide`: Both the screen and the drawer slide on swipe to reveal the drawer.
310
310
-`permanent`: A permanent drawer is shown as a sidebar. Useful for having always visible drawer on larger screens.
@@ -513,7 +513,7 @@ navigation.toggleDrawer();
513
513
514
514
#### `jumpTo`
515
515
516
-
Navigates to an existing screen in the drawer navigator. The method accepts following arguments:
516
+
Navigates to an existing screen in the drawer navigator. The method accepts the following arguments:
517
517
518
518
-`name` - _string_ - Name of the route to jump to.
519
519
-`params` - _object_ - Screen params to pass to the destination route.
@@ -578,7 +578,7 @@ import { getDrawerStatusFromState } from '@react-navigation/drawer';
For class components, you can listen tp the `state` event to check if drawer was opened or closed:
581
+
For class components, you can listen to the `state` event to check if drawer was opened or closed:
582
582
583
583
```js
584
584
classProfileextendsReact.Component {
@@ -603,4 +603,4 @@ class Profile extends React.Component {
603
603
604
604
## Nesting drawer navigators inside others
605
605
606
-
If a drawer navigator is nested inside of another navigator that provides some UI, for example a tab navigator or stack navigator, then the drawer will be rendered below the UI from those navigators. The drawer will appear below the tab bar and below the header of the stack. You will need to make the drawer navigator the parent of any navigator where the drawer should be rendered on top of its UI.
606
+
If a drawer navigator is nested inside of another navigator that provides some UI, for example, a tab navigator or stack navigator, then the drawer will be rendered below the UI from those navigators. The drawer will appear below the tab bar and below the header of the stack. You will need to make the drawer navigator the parent of any navigator where the drawer should be rendered on top of its UI.
0 commit comments