Skip to content
This repository was archived by the owner on Dec 3, 2022. It is now read-only.

Commit 01ee23b

Browse files
committed
Improve deps and fix action event
1 parent 09497fd commit 01ee23b

File tree

3 files changed

+51
-80
lines changed

3 files changed

+51
-80
lines changed

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@
3232
"url": "https://github.com/react-navigation/react-navigation-hooks/issues"
3333
},
3434
"homepage": "https://github.com/react-navigation/react-navigation-hooks#readme",
35-
"dependencies": {
36-
"history": "^4.7.2",
37-
"query-string": "^6.2.0"
38-
},
35+
"dependencies": {},
3936
"devDependencies": {
4037
"babel-cli": "^6.26.0",
4138
"babel-jest": "^22.4.1",
@@ -53,10 +50,10 @@
5350
"jest": "^22.1.3",
5451
"jest-expo": "^30.0.0",
5552
"prettier": "^1.8.2",
56-
"react": "16.3.1",
57-
"react-dom": "16.3.1",
53+
"react": "16.7.0-alpha.0",
54+
"react-dom": "16.7.0-alpha.0",
5855
"react-native": "^0.55.4",
59-
"react-test-renderer": "16.3.1",
56+
"react-test-renderer": "16.7.0-alpha.0",
6057
"release-it": "^7.6.1"
6158
},
6259
"peerDependencies": {

src/Hooks.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@ export function useNavigationEvents(handleEvt) {
2121
const navigation = useNavigation();
2222
useEffect(
2323
() => {
24-
const sWF = navigation.addListener('willFocus', handleEvt);
25-
const sDF = navigation.addListener('didFocus', handleEvt);
26-
const sWB = navigation.addListener('willBlur', handleEvt);
27-
const sDB = navigation.addListener('didBlur', handleEvt);
24+
const subsA = navigation.addListener('action', handleEvt);
25+
const subsWF = navigation.addListener('willFocus', handleEvt);
26+
const subsDF = navigation.addListener('didFocus', handleEvt);
27+
const subsWB = navigation.addListener('willBlur', handleEvt);
28+
const subsDB = navigation.addListener('didBlur', handleEvt);
2829
return () => {
29-
sWF.remove();
30-
sDF.remove();
31-
sWB.remove();
32-
sDB.remove();
30+
subsA.remove();
31+
subsWF.remove();
32+
subsDF.remove();
33+
subsWB.remove();
34+
subsDB.remove();
3335
};
3436
},
3537
// For TODO consideration: If the events are tied to the navigation object and the key

yarn.lock

Lines changed: 37 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -3596,7 +3596,7 @@ fbjs-scripts@^0.8.1:
35963596
semver "^5.1.0"
35973597
through2 "^2.0.0"
35983598

3599-
fbjs@^0.8.14, fbjs@^0.8.16, fbjs@^0.8.9:
3599+
fbjs@^0.8.14, fbjs@^0.8.9:
36003600
version "0.8.17"
36013601
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
36023602
integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=
@@ -4153,17 +4153,6 @@ hasha@^2.2.0:
41534153
is-stream "^1.0.1"
41544154
pinkie-promise "^2.0.0"
41554155

4156-
history@^4.7.2:
4157-
version "4.7.2"
4158-
resolved "https://registry.yarnpkg.com/history/-/history-4.7.2.tgz#22b5c7f31633c5b8021c7f4a8a954ac139ee8d5b"
4159-
integrity sha512-1zkBRWW6XweO0NBcjiphtVJVsIQ+SXF29z9DVkceeaSLVMFXHool+fdCZD4spDCfZJCILPILc3bm7Bc+HRi0nA==
4160-
dependencies:
4161-
invariant "^2.2.1"
4162-
loose-envify "^1.2.0"
4163-
resolve-pathname "^2.2.0"
4164-
value-equal "^0.4.0"
4165-
warning "^3.0.0"
4166-
41674156
home-or-tmp@^2.0.0:
41684157
version "2.0.0"
41694158
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
@@ -4373,7 +4362,7 @@ into-stream@^3.1.0:
43734362
from2 "^2.1.1"
43744363
p-is-promise "^1.1.0"
43754364

4376-
invariant@^2.2.0, invariant@^2.2.1, invariant@^2.2.2:
4365+
invariant@^2.2.0, invariant@^2.2.2:
43774366
version "2.2.4"
43784367
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
43794368
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
@@ -5539,7 +5528,7 @@ log-symbols@^2.2.0:
55395528
dependencies:
55405529
chalk "^2.0.1"
55415530

5542-
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1:
5531+
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
55435532
version "1.4.0"
55445533
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
55455534
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -6712,7 +6701,7 @@ promise@^7.1.1:
67126701
dependencies:
67136702
asap "~2.0.3"
67146703

6715-
prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.2:
6704+
prop-types@^15.5.8, prop-types@^15.6.2:
67166705
version "15.6.2"
67176706
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
67186707
integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==
@@ -6759,14 +6748,6 @@ query-string@^5.0.1:
67596748
object-assign "^4.1.0"
67606749
strict-uri-encode "^1.0.0"
67616750

6762-
query-string@^6.2.0:
6763-
version "6.2.0"
6764-
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.2.0.tgz#468edeb542b7e0538f9f9b1aeb26f034f19c86e1"
6765-
integrity sha512-5wupExkIt8RYL4h/FE+WTg3JHk62e6fFPWtAZA9J5IWK1PfTfKkMS93HBUHcFpeYi9KsY5pFbh+ldvEyaz5MyA==
6766-
dependencies:
6767-
decode-uri-component "^0.2.0"
6768-
strict-uri-encode "^2.0.0"
6769-
67706751
quick-lru@^1.0.0:
67716752
version "1.1.0"
67726753
resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8"
@@ -6814,21 +6795,26 @@ react-devtools-core@3.1.0:
68146795
shell-quote "^1.6.1"
68156796
ws "^2.0.3"
68166797

6817-
react-dom@16.3.1:
6818-
version "16.3.1"
6819-
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.3.1.tgz#6a3c90a4fb62f915bdbcf6204422d93a7d4ca573"
6820-
integrity sha512-2Infg89vzahq8nfVi1GkjPqq0vrBvf0f3T0+dTtyjq4f6HKOqKixAK25Vr593O3QTx4kw/vmUtAJwerlevNWOA==
6798+
react-dom@16.7.0-alpha.0:
6799+
version "16.7.0-alpha.0"
6800+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.7.0-alpha.0.tgz#8379158d4c76d63c989f325f45dfa5762582584f"
6801+
integrity sha512-/XUn1ldxmoV2B7ov0rWT5LMZaaHMlF9GGLkUsmPRxmWTJwRDOuAPXidSaSlmR/VOhDSI1s+v3+KzFqhhDFJxYA==
68216802
dependencies:
6822-
fbjs "^0.8.16"
68236803
loose-envify "^1.1.0"
68246804
object-assign "^4.1.1"
6825-
prop-types "^15.6.0"
6805+
prop-types "^15.6.2"
6806+
scheduler "^0.11.0-alpha.0"
68266807

6827-
react-is@^16.3.1, react-is@^16.5.2:
6808+
react-is@^16.5.2:
68286809
version "16.5.2"
68296810
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.5.2.tgz#e2a7b7c3f5d48062eb769fcb123505eb928722e3"
68306811
integrity sha512-hSl7E6l25GTjNEZATqZIuWOgSnpXb3kD0DVCujmg46K5zLxsbiKaaT6VO9slkSBDPZfYs30lwfJwbOFOnoEnKQ==
68316812

6813+
react-is@^16.7.0-alpha.0:
6814+
version "16.7.0-alpha.0"
6815+
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.7.0-alpha.0.tgz#0c92b82ba8e3d938a09697ce459d019f059421ed"
6816+
integrity sha512-8jBaW1rcnUoZFJ4wB5W6xgnNfr70pIW6DadourJ6zkgXZVVcACbUkZyfjI/zI84uyopCJQ6VFHY6qGh6wfJ59Q==
6817+
68326818
react-native@^0.55.4:
68336819
version "0.55.4"
68346820
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.55.4.tgz#eecffada3750a928e2ddd07cf11d857ae9751c30"
@@ -6902,15 +6888,15 @@ react-proxy@^1.1.7:
69026888
lodash "^4.6.1"
69036889
react-deep-force-update "^1.0.0"
69046890

6905-
react-test-renderer@16.3.1:
6906-
version "16.3.1"
6907-
resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.3.1.tgz#d9257936d8535bd40f57f3d5a84e7b0452fb17f2"
6908-
integrity sha512-emEcIPUowMjT5EQ+rrb0FAwVCzuJ+LKDweoYDh073v2/jHxrBDPUk8nzI5dofG3R+140+Bb9TMcT2Ez5OP6pQw==
6891+
react-test-renderer@16.7.0-alpha.0:
6892+
version "16.7.0-alpha.0"
6893+
resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.7.0-alpha.0.tgz#f60e888621537cf8301fc154e8e98e59fb9c7050"
6894+
integrity sha512-yOJTaUgy7V/Lpmv61g2oJdwEGUiAVJ21mYlHtUniUC8rW0HVpTVMDAVSEqgjlCYDfTwGh3hNTvoYaODJzkQKMw==
69096895
dependencies:
6910-
fbjs "^0.8.16"
69116896
object-assign "^4.1.1"
6912-
prop-types "^15.6.0"
6913-
react-is "^16.3.1"
6897+
prop-types "^15.6.2"
6898+
react-is "^16.7.0-alpha.0"
6899+
scheduler "^0.11.0-alpha.0"
69146900

69156901
react-test-renderer@^16.3.1:
69166902
version "16.5.2"
@@ -6935,15 +6921,15 @@ react-transform-hmr@^1.0.4:
69356921
global "^4.3.0"
69366922
react-proxy "^1.1.7"
69376923

6938-
react@16.3.1:
6939-
version "16.3.1"
6940-
resolved "https://registry.yarnpkg.com/react/-/react-16.3.1.tgz#4a2da433d471251c69b6033ada30e2ed1202cfd8"
6941-
integrity sha512-NbkxN9jsZ6+G+ICsLdC7/wUD26uNbvKU/RAxEWgc9kcdKvROt+5d5j2cNQm5PSFTQ4WNGsR3pa4qL2Q0/WSy1w==
6924+
react@16.7.0-alpha.0:
6925+
version "16.7.0-alpha.0"
6926+
resolved "https://registry.yarnpkg.com/react/-/react-16.7.0-alpha.0.tgz#e2ed4abe6f268c9b092a1d1e572953684d1783a9"
6927+
integrity sha512-V0za4H01aoAF0SdzahHepvfvzTQ1xxkgMX4z8uKzn+wzZAlVk0IVpleqyxZWluqmdftNedj6fIIZRO/rVYVFvQ==
69426928
dependencies:
6943-
fbjs "^0.8.16"
69446929
loose-envify "^1.1.0"
69456930
object-assign "^4.1.1"
6946-
prop-types "^15.6.0"
6931+
prop-types "^15.6.2"
6932+
scheduler "^0.11.0-alpha.0"
69476933

69486934
read-pkg-up@^1.0.1:
69496935
version "1.0.1"
@@ -7311,11 +7297,6 @@ resolve-from@^3.0.0:
73117297
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
73127298
integrity sha1-six699nWiBvItuZTM17rywoYh0g=
73137299

7314-
resolve-pathname@^2.2.0:
7315-
version "2.2.0"
7316-
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.2.0.tgz#7e9ae21ed815fd63ab189adeee64dc831eefa879"
7317-
integrity sha512-bAFz9ld18RzJfddgrO2e/0S2O81710++chRMUxHjXOYKF6jTAMrUNZrEZ1PvV0zlhfjidm08iRPdTLPno1FuRg==
7318-
73197300
resolve-url@^0.2.1:
73207301
version "0.2.1"
73217302
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
@@ -7456,6 +7437,14 @@ schedule@^0.5.0:
74567437
dependencies:
74577438
object-assign "^4.1.1"
74587439

7440+
scheduler@^0.11.0-alpha.0:
7441+
version "0.11.0-alpha.0"
7442+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.11.0-alpha.0.tgz#7b132c726608993471db07866f2d59a52b9e190b"
7443+
integrity sha512-0tUDHYSyni/EHkMMBysVXVwfanCWWbLsulnDB1tGrQiWWrVuRVoclWCPHCYC/1iR5Rj34EQhxh3/F36V+F+ZpA==
7444+
dependencies:
7445+
loose-envify "^1.1.0"
7446+
object-assign "^4.1.1"
7447+
74597448
semver-diff@^2.0.0:
74607449
version "2.1.0"
74617450
resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36"
@@ -7822,11 +7811,6 @@ strict-uri-encode@^1.0.0:
78227811
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
78237812
integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=
78247813

7825-
strict-uri-encode@^2.0.0:
7826-
version "2.0.0"
7827-
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546"
7828-
integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY=
7829-
78307814
string-length@^2.0.0:
78317815
version "2.0.0"
78327816
resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed"
@@ -8402,11 +8386,6 @@ validate-npm-package-license@^3.0.1:
84028386
spdx-correct "^3.0.0"
84038387
spdx-expression-parse "^3.0.0"
84048388

8405-
value-equal@^0.4.0:
8406-
version "0.4.0"
8407-
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7"
8408-
integrity sha512-x+cYdNnaA3CxvMaTX0INdTCN8m8aF2uY9BvEqmxuYp8bL09cs/kWVQPVGcA35fMktdOsP69IgU7wFj/61dJHEw==
8409-
84108389
vary@~1.1.2:
84118390
version "1.1.2"
84128391
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
@@ -8457,13 +8436,6 @@ walker@~1.0.5:
84578436
dependencies:
84588437
makeerror "1.0.x"
84598438

8460-
warning@^3.0.0:
8461-
version "3.0.0"
8462-
resolved "https://registry.yarnpkg.com/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c"
8463-
integrity sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=
8464-
dependencies:
8465-
loose-envify "^1.0.0"
8466-
84678439
watch@~0.18.0:
84688440
version "0.18.0"
84698441
resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986"

0 commit comments

Comments
 (0)