expo / router

[ARCHIVE]: Expo Router has moved to expo/expo -- The File-based router for universal React Native apps

Home Page:https://docs.expo.dev/routing/introduction/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

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