I am creating a new react native app using react-navigation.
Every time I do npm install --save react-navigation
, I see a set of warnings related to react-native-gesture-handler. I am creating a brand new app using react-native init Test
and the next step was to install react-navigation.
Following are the warnings and error:
npm WARN jest-resolve@24.5.0 requires a peer of jest-haste-map@^24.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN jest-resolve-dependencies@24.5.0 requires a peer of jest-haste-map@^24.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN jest-snapshot@24.5.0 requires a peer of jest-haste-map@^24.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation-drawer@1.3.0 requires a peer of react-native-gesture-handler@^1.0.12 but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation-stack@1.1.1 requires a peer of react-native-gesture-handler@^1.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @react-navigation/native@3.3.0 requires a peer of react-native-gesture-handler@* but none is installed. You must install peer dependencies yourself.
On importing the library in my code and running on an iOS simulator, I get an error as follows:
Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Unable to resolve module `react-native-gesture-handler` from `Documents/Code/Test/node_modules/@react-navigation/native/src/Scrollables.js`: Module `react-native-gesture-handler` does not exist in the Haste module map
I tried deleting node_modules folder in my app and ran 'npm install' and 'npm install --save react-navigation' again, but that did solve the issue.
Requesting advice.