You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Going from Screen 1 to Screen 3 by replacing screen 1 and adding screen 2 behind screen 3 results in the correct state at the end where there are two routes ['screen 2', 'screen 3']. Using navigation.pop() works as expected and it would pop up to screen 2. The issue is when hitting the browser back from screen 3 I am taken back to screen 1.
Expected behavior
Browser back should perform the same as navigation.pop().
I think the issue lies in these lines of native/src/useLinking.tsx. The delta logic seems to only be accurate when one change is being processed at a time.
Maybe this logic needs to be executed for each state change regardless of render cycle?
Current behavior
When dispatching multiple navigation actions at a time (especially when one is a replace) the browser back functionality is broken:
Going from Screen 1 to Screen 3 by replacing screen 1 and adding screen 2 behind screen 3 results in the correct state at the end where there are two routes ['screen 2', 'screen 3']. Using
navigation.pop()
works as expected and it would pop up to screen 2. The issue is when hitting the browser back from screen 3 I am taken back to screen 1.Expected behavior
Browser back should perform the same as
navigation.pop()
.I think the issue lies in these lines of native/src/useLinking.tsx. The delta logic seems to only be accurate when one change is being processed at a time.
Maybe this logic needs to be executed for each state change regardless of render cycle?
Not sure tbh how it all works together.
Reproduction
https://snack.expo.dev/@jcoy/react-navigation-multiple-dispatch-browser-history-bug
Platform
Packages
Environment
The text was updated successfully, but these errors were encountered: