If I expo init
a new project and then follow the React Navigation v5 documentation:
$ expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
$ yarn add @react-navigation/stack
I end up with the following dependencies in my package.json
:
"dependencies": {
"@react-native-community/masked-view": "0.1.6",
"@react-navigation/stack": "^5.5.1",
"expo": "~37.0.3",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-native-gesture-handler": "~1.6.0",
"react-native-reanimated": "~1.7.0",
"react-native-safe-area-context": "0.7.3",
"react-native-screens": "~2.2.0",
"react-native-web": "~0.11.7"
},
If I instead follow the React Navigation v4 documentation:
$ expo install react-navigation react-native-gesture-handler react-native-reanimated react-native-screens
$ yarn add react-navigation-stack @react-native-community/masked-view react-native-safe-area-context
I get the following dependencies:
"dependencies": {
"@react-native-community/masked-view": "^0.1.10",
"expo": "~37.0.3",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-native-gesture-handler": "~1.6.0",
"react-native-reanimated": "~1.7.0",
"react-native-safe-area-context": "^3.0.3",
"react-native-screens": "~2.2.0",
"react-native-web": "~0.11.7",
"react-navigation": "^4.3.9",
"react-navigation-stack": "^2.7.0"
},
And here’s my environment:
$ expo diagnostics
Expo CLI 3.21.5 environment info:
System:
OS: macOS Mojave 10.14.5
Shell: 5.0.17 - /usr/local/bin/bash
Binaries:
Node: 12.18.0 - /usr/local/opt/node@12/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/opt/node@12/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
expo: ~37.0.3 => 37.0.12
react: ~16.9.0 => 16.9.0
react-dom: ~16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz => 0.61.4
react-native-web: ~0.11.7 => 0.11.7
react-navigation: ^4.3.9 => 4.3.9