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
Copy file name to clipboardExpand all lines: versioned_docs/version-6.x/drawer-navigator.md
+15-7Lines changed: 15 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,15 @@ Component that renders a navigation drawer which can be opened and closed via ge
14
14
15
15
## Installation
16
16
17
-
1.To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/drawer`](https://github.com/react-navigation/react-navigation/tree/main/packages/drawer):
17
+
To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/drawer`](https://github.com/react-navigation/react-navigation/tree/main/packages/drawer):
18
18
19
-
```bash npm2yarn
20
-
npm install @react-navigation/drawer
21
-
```
19
+
```bash npm2yarn
20
+
npm install @react-navigation/drawer
21
+
```
22
22
23
-
2. 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/).
23
+
Then, you need to install and configure the libraries that are required by the drawer navigator:
24
+
25
+
1. First, 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
26
25
27
If you have a Expo managed project, in your project directory, run:
26
28
@@ -34,15 +36,21 @@ Component that renders a navigation drawer which can be opened and closed via ge
3. To finalize installation of `react-native-gesture-handler`, add the following at the **top** (make sure it's at the top and there's nothing else before it) of your entry file, such as `index.js` or `App.js`:
39
+
The Drawer Navigator supports both Reanimated 1 and Reanimated 2. If you want to use Reanimated 2, make sure to configure it following the [installation guide](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation).
40
+
41
+
2. To finalize installation of `react-native-gesture-handler`, add the following at the **top** (make sure it's at the top and there's nothing else before it) of your entry file, such as `index.js` or `App.js`:
38
42
39
43
```js
40
44
import'react-native-gesture-handler';
41
45
```
42
46
43
47
> Note: If you are building for Android or iOS, do not skip this step, or your app may crash in production even if it works fine in development. This is not applicable to other platforms.
44
48
45
-
4. The Drawer Navigator supports both Reanimated 1 and Reanimated 2. If you want to use Reanimated 2, make sure to configure it following the [installation guide](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation).
49
+
3. If you're on a Mac and developing for iOS, you also need to install the pods (via [Cocoapods](https://cocoapods.org/)) to complete the linking.
You also need to install [`react-native-pager-view`](https://github.com/callstack/react-native-pager-view).
25
+
Then, you need to install [`react-native-pager-view`](https://github.com/callstack/react-native-pager-view) which is required by the navigator.
26
26
27
27
If you have a Expo managed project, in your project directory, run:
28
28
@@ -35,7 +35,12 @@ If you have a bare React Native project, in your project directory, run:
35
35
```bash npm2yarn
36
36
npm install react-native-pager-view
37
37
```
38
-
> If you are developing for IOS, You'd need to run: **pod install**
38
+
39
+
If you're on a Mac and developing for iOS, you also need to install the pods (via [Cocoapods](https://cocoapods.org/)) to complete the linking.
If you have a Expo managed project, in your project directory, run:
34
32
35
-
If you have a bare React Native project, in your project directory, run:
33
+
```sh
34
+
npx expo install react-native-gesture-handler
35
+
```
36
36
37
-
```bash npm2yarn
38
-
npm install react-native-gesture-handler
39
-
```
37
+
If you have a bare React Native project, in your project directory, run:
40
38
41
-
To finalize installation of `react-native-gesture-handler`, add the following at the **top** (make sure it's at the top and there's nothing else before it) of your entry file, such as `index.js` or `App.js`:
39
+
```bash npm2yarn
40
+
npm install react-native-gesture-handler
41
+
```
42
42
43
-
```js
44
-
import'react-native-gesture-handler';
45
-
```
43
+
2. To finalize installation of `react-native-gesture-handler`, add the following at the **top** (make sure it's at the top and there's nothing else before it) of your entry file, such as `index.js` or `App.js`:
46
44
47
-
> Note: If you are building for Android or iOS, do not skip this step, or your app may crash in production even if it works fine in development. This is not applicable to other platforms.
45
+
```js
46
+
import'react-native-gesture-handler';
47
+
```
48
48
49
-
Optionally, you can also install [`@react-native-masked-view/masked-view`](https://github.com/react-native-masked-view/masked-view). This is needed if you want to use UIKit style animations for the header ([`HeaderStyleInterpolators.forUIKit`](#headerstyleinterpolators)).
49
+
> Note: If you are building for Android or iOS, do not skip this step, or your app may crash in production even if it works fine in development. This is not applicable to other platforms.
50
50
51
-
If you have a Expo managed project, in your project directory, run:
51
+
3. Optionally, you can also install [`@react-native-masked-view/masked-view`](https://github.com/react-native-masked-view/masked-view). This is needed if you want to use UIKit style animations for the header ([`HeaderStyleInterpolators.forUIKit`](#headerstyleinterpolators)).
0 commit comments