Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[router] fix relative navigation on hoisted routes (#27778)
# Why Fix #27753 # How This `isIndexPath` function was not taking in account hoisted index routes that may not have the `param` structure Take the following structure. ``` _layout // Stack parent/ └── child/ ├── index // name: parent/child/index └── page // name: parent/child/page ``` Because there are no route params or nested `_layout`, all routes are hoisted to the root `_layout`. The existing logic for only checking for `route.params` is insufficient as it will not exist. Additionally we cannot check for `name: 'index'` as hoisted routes have complex names. # Test Plan I think our existing tests are fine, just added one for this scenario # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
- Loading branch information
1 parent
1e5f916
commit 5fc443e
Showing
6 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters