···11+diff --git a/node_modules/@react-navigation/native/lib/commonjs/useLinking.js b/node_modules/@react-navigation/native/lib/commonjs/useLinking.js
22+index ef4f368..2b0da35 100644
33+--- a/node_modules/@react-navigation/native/lib/commonjs/useLinking.js
44++++ b/node_modules/@react-navigation/native/lib/commonjs/useLinking.js
55+@@ -273,8 +273,12 @@ function useLinking(ref, _ref) {
66+ });
77+ const currentIndex = history.index;
88+ try {
99+- if (nextIndex !== -1 && nextIndex < currentIndex) {
1010+- // An existing entry for this path exists and it's less than current index, go back to that
1111++ if (
1212++ nextIndex !== -1 &&
1313++ nextIndex < currentIndex &&
1414++ // We should only go back if the entry exists and it's less than current index
1515++ history.get(nextIndex - currentIndex)
1616++ ) { // An existing entry for this path exists and it's less than current index, go back to that
1717+ await history.go(nextIndex - currentIndex);
1818+ } else {
1919+ // We couldn't find an existing entry to go back to, so we'll go back by the delta
2020+diff --git a/node_modules/@react-navigation/native/lib/module/useLinking.js b/node_modules/@react-navigation/native/lib/module/useLinking.js
2121+index 62a3b43..11a5a28 100644
2222+--- a/node_modules/@react-navigation/native/lib/module/useLinking.js
2323++++ b/node_modules/@react-navigation/native/lib/module/useLinking.js
2424+@@ -264,8 +264,12 @@ export default function useLinking(ref, _ref) {
2525+ });
2626+ const currentIndex = history.index;
2727+ try {
2828+- if (nextIndex !== -1 && nextIndex < currentIndex) {
2929+- // An existing entry for this path exists and it's less than current index, go back to that
3030++ if (
3131++ nextIndex !== -1 &&
3232++ nextIndex < currentIndex &&
3333++ // We should only go back if the entry exists and it's less than current index
3434++ history.get(nextIndex - currentIndex)
3535++ ) { // An existing entry for this path exists and it's less than current index, go back to that
3636+ await history.go(nextIndex - currentIndex);
3737+ } else {
3838+ // We couldn't find an existing entry to go back to, so we'll go back by the delta
3939+diff --git a/node_modules/@react-navigation/native/src/useLinking.tsx b/node_modules/@react-navigation/native/src/useLinking.tsx
4040+index 3db40b7..9ba4ecd 100644
4141+--- a/node_modules/@react-navigation/native/src/useLinking.tsx
4242++++ b/node_modules/@react-navigation/native/src/useLinking.tsx
4343+@@ -381,7 +381,12 @@ export default function useLinking(
4444+ const currentIndex = history.index;
4545+4646+ try {
4747+- if (nextIndex !== -1 && nextIndex < currentIndex) {
4848++ if (
4949++ nextIndex !== -1 &&
5050++ nextIndex < currentIndex &&
5151++ // We should only go back if the entry exists and it's less than current index
5252++ history.get(nextIndex - currentIndex)
5353++ ) {
5454+ // An existing entry for this path exists and it's less than current index, go back to that
5555+ await history.go(nextIndex - currentIndex);
5656+ } else {
+5
patches/@react-navigation+native+6.1.7.patch.md
···11+# React Navigation history bug patch
22+33+This patches react-navigation to fix the issues in https://github.com/bluesky-social/social-app/issues/710.
44+55+This is based on the PR found at https://github.com/react-navigation/react-navigation/pull/11833