react-navigation/react-navigation.github.io

When upgrading react-navigation from v5 to v6, should we still import react-native-gesture-handler at the top?

Adnan-Bacic opened this issue · 1 comments

I originally just asked this on stack overflow because i didnt feel like i belonged to the react-navigation repo, but i just found out about this repo, and i think my question belongs here.

Original thread: https://stackoverflow.com/questions/70435011/when-upgrading-react-navigation-from-v5-to-v6-should-we-still-import-react-nati
Text:

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.

my error was due to other reasons. and i found out that the v6 docs default to showing the /native-stack for their example. previously it was the /stack. the docs for this still mention the import. closing this.