Skip to content

Commit 140d523

Browse files
renovate[bot]erik-slovakrostislav-simonik
authored
fix(deps): update react-navigation monorepo (#541)
* fix(deps): update react-navigation monorepo * fix: handle missing state in `useIsInitial` * fix: throw an error if the navigation state is missing * style: add missing ending line --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Erik Slovak <[email protected]> Co-authored-by: Rostislav Simonik <[email protected]>
1 parent 7ad1ec2 commit 140d523

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@
4343
"@txo/types": "^1.7.0"
4444
},
4545
"peerDependencies": {
46-
"@react-navigation/devtools": "^6.0.20",
47-
"@react-navigation/native": "^6.1.10",
46+
"@react-navigation/devtools": "^6.0.23",
47+
"@react-navigation/native": "^6.1.14",
4848
"@txo-peer-dep/log": "^4.0.4",
4949
"react-native": "*"
5050
},
5151
"devDependencies": {
5252
"@babel/core": "^7.24.4",
5353
"@babel/preset-env": "^7.24.4",
54-
"@react-navigation/devtools": "^6.0.20",
55-
"@react-navigation/native": "^6.1.10",
54+
"@react-navigation/devtools": "^6.0.23",
55+
"@react-navigation/native": "^6.1.14",
5656
"@txo-peer-dep/log": "^4.0.4",
5757
"@txo/commitlint": "^1.0.14",
5858
"@txo/log-console": "^3.0.0",

src/Hooks/UseIsInitial.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export const useIsInitial = (): boolean => {
1717
const navigation = useNavigation()
1818
const isInitial = useMemo(() => {
1919
const state = navigation.getState()
20+
if (state == null) {
21+
throw new Error('Navigation state is missing. Did you run `useIsInitial` outside of the navigator?')
22+
}
2023
return calculateIsInitial(state, route)
2124
}, [navigation, route])
2225
return isInitial

yarn.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2354,10 +2354,10 @@
23542354
invariant "^2.2.4"
23552355
nullthrows "^1.1.1"
23562356

2357-
"@react-navigation/core@^6.4.10":
2358-
version "6.4.10"
2359-
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-6.4.10.tgz#0c52621968b35e3a75e189e823d3b9e3bad77aff"
2360-
integrity sha512-oYhqxETRHNHKsipm/BtGL0LI43Hs2VSFoWMbBdHK9OqgQPjTVUitslgLcPpo4zApCcmBWoOLX2qPxhsBda644A==
2357+
"@react-navigation/core@^6.4.13":
2358+
version "6.4.13"
2359+
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-6.4.13.tgz#27cf33d963f59aeeb36f27514a9744ab818097b3"
2360+
integrity sha512-RBUpNG11SEYfvvWefJPxz8Xu/feWuPxln7ddRSY92aKs7u6fj/Z694Jun76Gmmw/RIHW6xcu3PH2v3Wm8nbumg==
23612361
dependencies:
23622362
"@react-navigation/routers" "^6.1.9"
23632363
escape-string-regexp "^4.0.0"
@@ -2366,21 +2366,21 @@
23662366
react-is "^16.13.0"
23672367
use-latest-callback "^0.1.7"
23682368

2369-
"@react-navigation/devtools@^6.0.20":
2370-
version "6.0.20"
2371-
resolved "https://registry.yarnpkg.com/@react-navigation/devtools/-/devtools-6.0.20.tgz#67ecdac967c3aea989303ac55b175c0a63fa63aa"
2372-
integrity sha512-FtO7j+mVHZb89kw2JkKL1TYWRMNUp/g3blc/yNbuJVbKst9HsEFfThM1fAUiX9vU2uicJ6MeisLodDtdwCxsKw==
2369+
"@react-navigation/devtools@^6.0.23":
2370+
version "6.0.23"
2371+
resolved "https://registry.yarnpkg.com/@react-navigation/devtools/-/devtools-6.0.23.tgz#b052a37550eeead95fefd53b60a1cd13364519d6"
2372+
integrity sha512-az4iocQTHXnkJ0in6XN52H8OwJZ83UgRNiy9fJRn4BiXTskNHyXbE9wEeVQobol0OMrEAwSFWPzFCjLHjlApfw==
23732373
dependencies:
23742374
deep-equal "^2.0.5"
23752375
nanoid "^3.1.23"
23762376
stacktrace-parser "^0.1.10"
23772377

2378-
"@react-navigation/native@^6.1.10":
2379-
version "6.1.10"
2380-
resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-6.1.10.tgz#d108423ae3acbe13f11d9b7351c1f5522d8391a5"
2381-
integrity sha512-jDG89TbZItY7W7rIcS1RqT63vWOPD4XuQLNKqZO0DY7mKnKh/CGBd0eg3nDMXUl143Qp//IxJKe2TfBQRDEU4A==
2378+
"@react-navigation/native@^6.1.14":
2379+
version "6.1.14"
2380+
resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-6.1.14.tgz#882eb2048dba655971dd48f1a2f25836d246912e"
2381+
integrity sha512-nCrVi4cHXx6VnXV8fj+lLb8zjLt1LZkpxudhfV/i1KstgaoGzh9FgFDIvbWONGE8f403FIsYUnZxKHvN7asp1w==
23822382
dependencies:
2383-
"@react-navigation/core" "^6.4.10"
2383+
"@react-navigation/core" "^6.4.13"
23842384
escape-string-regexp "^4.0.0"
23852385
fast-deep-equal "^3.1.3"
23862386
nanoid "^3.1.23"

0 commit comments

Comments
 (0)