Unable to navigate to modal stack initial route, within (group) directory
leggomuhgreggo opened this issue · comments
Which package manager are you using? (Yarn is recommended)
Yarn
Summary
This folder structure, using the group syntax doesn't seem to support linking to the index initial route of the modal stack
app
| -- (modal-stack) <-- links here don't work
| |-- _layout.tsx
| |-- modal-screen-1.tsx
| |-- modal-screen-2.tsx
| -- _layout.tsx
| -- index.tsx
Screen Recording
Simulator.Screen.Recording.-.iPhone.14.-.2023-08-05.at.15.01.25.mp4
Group Folder
- ❌
<Link href="/(modal-stack)/">(modal-stack)</Link>
- ✅
<Link href="/(modal-stack)/modal-screen-1">modal-screen-1</Link>
Normal Path Folder
- ✅
<Link href="/modal-stack/">modal-stack</Link>
- ✅
<Link href="/modal-stack/modal-screen-1">modal-screen-1</Link>
Minimal reproducible example
https://github.com/leggomuhgreggo/nav-testing/tree/expo-router-repro/modal-stack-grouped
UPDATE: verified issue still exists in expo-router@3.1.2
https://github.com/leggomuhgreggo/nav-testing/tree/expo-router-repro/modal-stack-grouped-v3
I think the issue is that the router can't distinguish between the root index and the (group)
index.
I theory, it seems like this should be possible w/ unstable_settings.initialRouteName
but this is not currently supported
Can also define (group)/index.tsx
but this isn't always ideal.
@leggomuhgreggo Can you please create a new issue on the main repo https://github.com/expo/expo, as development has moved there.
When you do so, can you please update your reproduction repo to be a minimal example. Providing a repo with 6 different apps is not a good minimal reproduction