Skip to content

<Link> does not "unwind" to the route that is already in the stack #33014

Closed
@mbackonja

Description

@mbackonja

Minimal reproducible example

https://github.com/mbackonja/expo-router-issue

Which package manager are you using? (Yarn is recommended)

npm

If the issue is web-related, please select the bundler (web.bundler in the app.json)

None

Summary

Documentation says:

Expo Router uses a stack-based navigation approach. Each new route you navigate to get added to a stack. If you navigate to a route already in the stack, the stack unwinds back to that existing route.

For example, when you navigate from /feed to /profile, the stack contains /feed and /profile. If you then navigate to /settings, the stack contains /feed, /profile, and /settings. If you then navigate back to /feed, the stack unwinds back to /feed.

And it was working just like that in the previous Expo SDK 51 version. After upgrading to Expo SDK 52, this feature looks broken. I included minimum reproducible code in the GitHub repo and I'm providing two screen recordings for easier understanding of what's happening...

Expo SDK 52 (broken):

android_issue.webm

Expo SDK 51 (working):

android_working.webm

It was tested on both Android and iOS, both in a Simulator and on real devices.

Environment

expo-env-info 1.2.1 environment info:
    System:
      OS: macOS 15.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node
      npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm
      Watchman: 2024.11.11.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.16.2 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.1, iOS 18.1, macOS 15.1, tvOS 18.1, visionOS 2.1, watchOS 11.1
    IDEs:
      Android Studio: 2024.2 AI-242.23339.11.2421.12550806
      Xcode: 16.1/16B40 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~52.0.7 => 52.0.7
      expo-router: ~4.0.6 => 4.0.6
      react: 18.3.1 => 18.3.1
      react-dom: 18.3.1 => 18.3.1
      react-native: 0.76.2 => 0.76.2
      react-native-web: ~0.19.13 => 0.19.13
    npmGlobalPackages:
      eas-cli: 13.2.3
    Expo Workflow: managed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Routerexpo-routerneeds reviewIssue is ready to be reviewed by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions