Skip to content

Commit 355399a

Browse files
committed
Improve stack and drawer installation instructions
1 parent c4058ab commit 355399a

File tree

3 files changed

+53
-32
lines changed

3 files changed

+53
-32
lines changed

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

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ Component that renders a navigation drawer which can be opened and closed via ge
1414

1515
## Installation
1616

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):
1818

19-
```bash npm2yarn
20-
npm install @react-navigation/drawer
21-
```
19+
```bash npm2yarn
20+
npm install @react-navigation/drawer
21+
```
2222

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/).
2426

2527
If you have a Expo managed project, in your project directory, run:
2628

@@ -34,15 +36,21 @@ Component that renders a navigation drawer which can be opened and closed via ge
3436
npm install react-native-gesture-handler react-native-reanimated
3537
```
3638

37-
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`:
3842

3943
```js
4044
import 'react-native-gesture-handler';
4145
```
4246

4347
> 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.
4448
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.
50+
51+
```sh
52+
npx pod-install ios
53+
```
4654

4755
## API Definition
4856

versioned_docs/version-6.x/material-top-tab-navigator.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To use this navigator, ensure that you have [`@react-navigation/native` and its
2222
npm install @react-navigation/material-top-tabs react-native-tab-view
2323
```
2424

25-
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.
2626

2727
If you have a Expo managed project, in your project directory, run:
2828

@@ -35,7 +35,12 @@ If you have a bare React Native project, in your project directory, run:
3535
```bash npm2yarn
3636
npm install react-native-pager-view
3737
```
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.
40+
41+
```sh
42+
npx pod-install ios
43+
```
3944

4045
## API Definition
4146

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

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,49 @@ To use this navigator, ensure that you have [`@react-navigation/native` and its
2424
npm install @react-navigation/stack
2525
```
2626

27-
You also need to install [`react-native-gesture-handler`](https://docs.swmansion.com/react-native-gesture-handler/).
27+
Then, you need to install and configure the libraries that are required by the stack navigator:
2828

29-
If you have a Expo managed project, in your project directory, run:
29+
1. First, install [`react-native-gesture-handler`](https://docs.swmansion.com/react-native-gesture-handler/).
3030

31-
```sh
32-
npx expo install react-native-gesture-handler
33-
```
31+
If you have a Expo managed project, in your project directory, run:
3432

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+
```
3636

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:
4038

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+
```
4242

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`:
4644

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+
```
4848

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.
5050
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)).
5252

53-
```sh
54-
npx expo install @react-native-masked-view/masked-view
55-
```
53+
If you have a Expo managed project, in your project directory, run:
5654

57-
If you have a bare React Native project, in your project directory, run:
55+
```sh
56+
npx expo install @react-native-masked-view/masked-view
57+
```
5858

59-
```bash npm2yarn
60-
npm install @react-native-masked-view/masked-view
61-
```
59+
If you have a bare React Native project, in your project directory, run:
60+
61+
```bash npm2yarn
62+
npm install @react-native-masked-view/masked-view
63+
```
64+
65+
4. 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.
66+
67+
```sh
68+
npx pod-install ios
69+
```
6270

6371
## API Definition
6472

0 commit comments

Comments
 (0)