Skip to content

Commit 585978d

Browse files
committed
Remove now-unnecessary gesture handler import
1 parent ea5bcae commit 585978d

File tree

3 files changed

+4
-79
lines changed

3 files changed

+4
-79
lines changed

versioned_docs/version-7.x/drawer-layout.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,7 @@ Then, you need to install and configure the libraries that are required by the d
3838

3939
2. Configure the Reanimated Babel Plugin in your project following the [installation guide](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started).
4040

41-
3. To finalize the installation of `react-native-gesture-handler`, we need to conditionally import it. To do this, create 2 files:
42-
43-
```js title="gesture-handler.native.js"
44-
// Only import react-native-gesture-handler on native platforms
45-
import 'react-native-gesture-handler';
46-
```
47-
48-
```js title="gesture-handler.js"
49-
// Don't import react-native-gesture-handler on web
50-
```
51-
52-
Now, 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`:
53-
54-
```js
55-
import './gesture-handler';
56-
```
57-
58-
Since the drawer layout doesn't use `react-native-gesture-handler` on Web, this avoids unnecessarily increasing the bundle size.
59-
60-
:::warning
61-
62-
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.
63-
64-
:::
65-
66-
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.
41+
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.
6742

6843
```bash
6944
npx pod-install ios

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

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,7 @@ Then, you need to install and configure the libraries that are required by the d
3838

3939
2. Configure the Reanimated Babel Plugin in your project following the [installation guide](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started).
4040

41-
3. To finalize the installation of `react-native-gesture-handler`, we need to conditionally import it. To do this, create 2 files:
42-
43-
```js title="gesture-handler.native.js"
44-
// Only import react-native-gesture-handler on native platforms
45-
import 'react-native-gesture-handler';
46-
```
47-
48-
```js title="gesture-handler.js"
49-
// Don't import react-native-gesture-handler on web
50-
```
51-
52-
Now, 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`:
53-
54-
```js
55-
import './gesture-handler';
56-
```
57-
58-
Since the drawer navigator doesn't use `react-native-gesture-handler` on Web, this avoids unnecessarily increasing the bundle size.
59-
60-
:::warning
61-
62-
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.
63-
64-
:::
65-
66-
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.
41+
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.
6742

6843
```bash
6944
npx pod-install ios

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

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,7 @@ Then, you need to install and configure the libraries that are required by the s
4242
npm install react-native-gesture-handler
4343
```
4444

45-
2. To finalize the installation of `react-native-gesture-handler`, we need to conditionally import it. To do this, create 2 files:
46-
47-
```js title="gesture-handler.native.js"
48-
// Only import react-native-gesture-handler on native platforms
49-
import 'react-native-gesture-handler';
50-
```
51-
52-
```js title="gesture-handler.js"
53-
// Don't import react-native-gesture-handler on web
54-
```
55-
56-
Now, 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`:
57-
58-
```js
59-
import './gesture-handler';
60-
```
61-
62-
Since the stack navigator doesn't use `react-native-gesture-handler` on Web, this avoids unnecessarily increasing the bundle size.
63-
64-
:::warning
65-
66-
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.
67-
68-
:::
69-
70-
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)).
45+
2. 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)).
7146

7247
If you have a Expo managed project, in your project directory, run:
7348

@@ -81,7 +56,7 @@ Then, you need to install and configure the libraries that are required by the s
8156
npm install @react-native-masked-view/masked-view
8257
```
8358

84-
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.
59+
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.
8560

8661
```bash
8762
npx pod-install ios

0 commit comments

Comments
 (0)