Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

Commit 49758b4

Browse files
committed
fix: add dummy functions to throw on wrong version
1 parent 3c1a61e commit 49758b4

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"homepage": "https://github.com/react-navigation/react-navigation-native#readme",
4242
"dependencies": {
4343
"hoist-non-react-statics": "^3.3.2",
44-
"react-native-safe-area-view": "^0.14.1"
44+
"react-native-safe-area-view": "^0.14.8"
4545
},
4646
"devDependencies": {
4747
"@expo/vector-icons": "^6.2.0",

src/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* eslint-disable import/no-commonjs */
22

3+
import throwIfWrongVersion from './throwIfWrongVersion';
4+
35
module.exports = {
46
get createAppContainer() {
57
return require('./createAppContainer').default;
@@ -39,4 +41,11 @@ module.exports = {
3941
get Themed() {
4042
return require('./Themed').default;
4143
},
44+
45+
get createNavigationFactory() {
46+
return throwIfWrongVersion;
47+
},
48+
get NavigationContainer() {
49+
return throwIfWrongVersion;
50+
},
4251
};

src/throwIfWrongVersion.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default function() {
2+
throw new Error(
3+
"This version of '@react-navigation/native' is not compatible with React Navigation 5. Make sure you install 5.x version of '@react-navigation/native'."
4+
);
5+
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7153,10 +7153,10 @@ [email protected]:
71537153
dependencies:
71547154
hoist-non-react-statics "^2.3.1"
71557155

7156-
react-native-safe-area-view@^0.14.1:
7157-
version "0.14.1"
7158-
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.14.1.tgz#3981f6f8628c1769a163313bd8c8eba5edecca0f"
7159-
integrity sha512-pLAPWdirNWO/1F6IYkbayW9nDIXkM2F/NPtigYNjZj9nISCW+G2dNuI39DI8LenkxYdhiDaGMXfQHHx9TRn6Fw==
7156+
react-native-safe-area-view@^0.14.8:
7157+
version "0.14.8"
7158+
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.14.8.tgz#ef33c46ff8164ae77acad48c3039ec9c34873e5b"
7159+
integrity sha512-MtRSIcZNstxv87Jet+UsPhEd1tpGe8cVskDXlP657x6rHpSrbrc+y13ZNXrwAgGNNhqQNX7UJT68ZIq//ZRmvw==
71607160
dependencies:
71617161
hoist-non-react-statics "^2.3.1"
71627162

0 commit comments

Comments
 (0)