2

The documentation for react-navigation v5 mentions this:

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

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.

with v6 being the currently newest, it doesnt mention that anywhere: https://reactnavigation.org/docs/getting-started/

it doesnt even say you have to install react-native-gesture-handler to begin with.

And the upgrade guide doesnt say you have to remove it: https://reactnavigation.org/docs/upgrading-from-5.x/

Now the reason im asking is because the v5 docs say your app may crash in production even if it works in development. that is IF you DONT import 'react-native-gesture-handler' at the top.

im currently in a situation where my app works in development and crashes in production. im using v6 of react-navigation, AND im still importing react-native-gesture-handler at the top. which made me wonder if that could have anything to do with it. its the production apps so i cant look at error messages, so im mostly just guessing. ive just thought about this before, how the documentation and upgrade guide didnt mention anything, and its just now that im releasing that i wonder if thats whats causing errors.

hndvf
  • 101
  • 8

1 Answers1

1

It does say it on the Stack Navigator setup page for v6.

zachary
  • 108
  • 1
  • 9
  • thanks a lot. i missed this since the v6 docs no longer default to using the stack navigator in their "getting started" guide. they now show the native-stack navigator: https://reactnavigation.org/docs/native-stack-navigator. which doesnt rely on react-native-gesture-handler. – hndvf Jan 07 '22 at 08:39