Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(router): support push going back to sibling with nested stack from a modal. #24166

Merged
merged 3 commits into from
Aug 30, 2023

Conversation

EvanBacon
Copy link
Contributor

Why

  • Fix issue reported by @blainekasten.
  • Increase logic in push to account for moving between sibling routes which all use the leaf-most name index.

How

  • If the target route name is index, then use the parent state as the route target. React Navigation would search for index when moving to slot/index via /slot. This would result in the wrong route being selected:
"routeNames": [
  "index",
  "slot",
  "(group)",
  "_sitemap",
  "[...404]"
],

Now we account for index routes by pushing up to slot so the StackRouter can identify the right screen.

Test Plan

  • The issue could be reproduced using our testing library.

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Aug 29, 2023
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Aug 29, 2023
@EvanBacon EvanBacon merged commit d57f6aa into main Aug 30, 2023
8 checks passed
@EvanBacon EvanBacon deleted the @evanbacon/router/blaine-aug29 branch August 30, 2023 17:17
EvanBacon added a commit to expo/router that referenced this pull request Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants