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: website/versioned_docs/version-4.x/troubleshooting.md
+42-2Lines changed: 42 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ original_id: troubleshooting
7
7
8
8
This section attempts to outline issues that can happen during setup and may not be related to React Navigation itself. Also see [common mistakes](common-mistakes.md).
9
9
10
+
Before troubleshooting an issue, make sure that you have upgraded to **the latest available versions** of the packages. You can install the latest versions by installing the packages again (e.g. `npm install package-name`).
11
+
10
12
## I'm getting an error "Unable to resolve module" after updating to the latest version
11
13
12
14
This might happen for 2 reasons:
@@ -25,7 +27,7 @@ expo start -c
25
27
If you're not using Expo, run:
26
28
27
29
```sh
28
-
react-native start --reset-cache
30
+
npx react-native start --reset-cache
29
31
```
30
32
31
33
If the module points to an npm package (i.e. the name of the module doesn't with `./`), then it's probably due to a missing peer dependency. To fix this, install the dependency in your project:
@@ -62,7 +64,45 @@ This and some similar errors might occur if you didn't link the [`react-native-g
62
64
63
65
Now rebuild the app and test on your device or simulator.
64
66
65
-
## I linked RNGestureHandler library but gestures won't work on Android
67
+
## I'm getting an error "TypeError: Cannot read property 'bind' of undefined" or "TypeError: propListener.apply is not a function"
68
+
69
+
This error can often happen if you have a Babel plugin that compiles the code in a non-spec compliant way. For example:
The above compiles class properties in`loose` mode, which is not spec compliant. To prevent such issues, avoid using any additional Babel plugins or presets which change the way Metro compiles code by default. Your `babel.config.js` should look like this:
If you have additional options configured here, try removing them to see if it fixes the issue. After changing config, always clear the cache.
92
+
93
+
If you're using Expo, run:
94
+
95
+
```sh
96
+
expo start -c
97
+
```
98
+
99
+
If you're not using Expo, run:
100
+
101
+
```sh
102
+
npx react-native start --reset-cache
103
+
```
104
+
105
+
## I linked `react-native-gesture-handler` library but gestures won't work on Android
66
106
67
107
This might happen if you didn't update your MainActivity.java file (or wherever you create an instance of ReactActivityDelegate), so that it uses the root view wrapper provided by this library.
Copy file name to clipboardExpand all lines: website/versioned_docs/version-5.x/hello-react-navigation.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -134,7 +134,7 @@ Sometimes we might want to pass additional props to a screen. We can do that wit
134
134
</Stack.Screen>
135
135
```
136
136
137
-
> Note: By default, React Navigation applies optimizations to screen components to prevent unnecessary renders. Using a render callback removes those optimizations. So if you use a render callback, you'll need to ensure that you use [`React.memo`](https://reactjs.org/docs/react-api.html#reactmemo) or [`React.PureComponent`](https://reactjs.org/docs/react-api.html#reactpurecomponent) for your screen components to prevent avoid performance issues.
137
+
> Note: By default, React Navigation applies optimizations to screen components to prevent unnecessary renders. Using a render callback removes those optimizations. So if you use a render callback, you'll need to ensure that you use [`React.memo`](https://reactjs.org/docs/react-api.html#reactmemo) or [`React.PureComponent`](https://reactjs.org/docs/react-api.html#reactpurecomponent) for your screen components to avoid performance issues.
Copy file name to clipboardExpand all lines: website/versioned_docs/version-5.x/troubleshooting.md
+5-7Lines changed: 5 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ original_id: troubleshooting
7
7
8
8
This section attempts to outline issues that users frequently encounter when first getting accustomed to using React Navigation. These issues may or may not be related to React Navigation itself.
9
9
10
+
Before troubleshooting an issue, make sure that you have upgraded to **the latest available versions** of the packages. You can install the latest versions by installing the packages again (e.g. `npm install package-name`).
11
+
10
12
## I'm getting an error "Unable to resolve module" after updating to the latest version
If you're testing on iOS and use Mac, make sure you have run `pod install` in the `ios/` folder:
68
70
69
71
```sh
70
-
cd ios; pod install;cd ..
72
+
cd ios
73
+
pod install
74
+
cd ..
71
75
```
72
76
73
77
Now rebuild the app and test on your device or simulator.
74
78
75
-
## I linked RNGestureHandler library but gestures won't work on Android
76
-
77
-
This might happen if you didn't update your MainActivity.java file (or wherever you create an instance of ReactActivityDelegate), so that it uses the root view wrapper provided by this library.
78
-
79
-
Check how to do it [here](https://software-mansion.github.io/react-native-gesture-handler/docs/getting-started.html).
80
-
81
79
## Pressing buttons don't do anything
82
80
83
81
Make sure you're not connected to Chrome Debugger. When connected to Chrome Debugger, you might encounter various issues related to timing, such as button presses and animations not working correctly.
0 commit comments