Skip to content

Commit 7c52429

Browse files
committed
[test] Fix v5 navigator linking in example app
1 parent 3680109 commit 7c52429

3 files changed

Lines changed: 17 additions & 21 deletions

File tree

example/metro.config.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77

88
const path = require("path");
99

10+
const resolvers = {
11+
"react-navigation-shared-element": "..",
12+
"@react-navigation/core": "../node_modules",
13+
"@react-navigation/native": "../node_modules",
14+
"@react-navigation/stack": "../node_modules",
15+
"@react-navigation/routers": "../node_modules"
16+
};
17+
1018
module.exports = {
1119
transformer: {
1220
getTransformOptions: async () => ({
@@ -24,12 +32,7 @@ module.exports = {
2432
{},
2533
{
2634
get: (_, name) =>
27-
path.resolve(
28-
name === "react-navigation-shared-element"
29-
? ".."
30-
: "./node_modules",
31-
name
32-
)
35+
path.resolve(resolvers[name] || "./node_modules", name)
3336
}
3437
)
3538
},

example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"@expo/vector-icons": "^10.0.6",
1010
"@react-native-community/masked-view": "^0.1.10",
1111
"@react-native-community/viewpager": "^3.3.0",
12-
"@react-navigation/native": "^5.1.6",
13-
"@react-navigation/stack": "^5.2.13",
12+
"@react-navigation/native": "link:../node_modules/@react-navigation/native",
13+
"@react-navigation/stack": "link:../node_modules/@react-navigation/stack",
1414
"expo": "~37.0.3",
1515
"expo-updates": "~0.1.0",
1616
"react": "~16.9.0",

example/yarn.lock

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,12 +1269,9 @@
12691269
hoist-non-react-statics "^3.3.2"
12701270
react-native-safe-area-view "^0.14.8"
12711271

1272-
"@react-navigation/native@^5.1.6":
1273-
version "5.1.6"
1274-
resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-5.1.6.tgz#932ff1b5b8b9f051d8e5cd3b016d05badaa01898"
1275-
integrity sha512-DLLSnh29AndrGjPrHJoAgObeO9TiyrGtrASl+SA3B4ksmz4dUV2t6vaRwHogn1kejvRd+1T8VD923d3K1rjy7w==
1276-
dependencies:
1277-
"@react-navigation/core" "^5.3.4"
1272+
"@react-navigation/native@link:../node_modules/@react-navigation/native":
1273+
version "0.0.0"
1274+
uid ""
12781275

12791276
"@react-navigation/routers@^5.4.0":
12801277
version "5.4.0"
@@ -1283,13 +1280,9 @@
12831280
dependencies:
12841281
nanoid "^3.0.2"
12851282

1286-
"@react-navigation/stack@^5.2.13":
1287-
version "5.2.13"
1288-
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.2.13.tgz#fa242f28beb8882fde1584cd23b1a9938abc5e17"
1289-
integrity sha512-bHT9cN5DKNpBHgftIzAM+MoBwWnz2952G5SSctXExQkQ73dwbkV1RnQw8t0MnRZyOpsynhJIdAG+me2QERhAbg==
1290-
dependencies:
1291-
color "^3.1.2"
1292-
react-native-iphone-x-helper "^1.2.1"
1283+
"@react-navigation/stack@link:../node_modules/@react-navigation/stack":
1284+
version "0.0.0"
1285+
uid ""
12931286

12941287
"@types/babel__core@^7.1.0":
12951288
version "7.1.7"

0 commit comments

Comments
 (0)