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

Layout in nested Slot causes <Link /> to not route in v2.

austin43 opened this issue · comments

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

yarn

Summary

When converting a normal modal.tsx file to a modal folder with a _layout and index file, <Link href="/modal" /> no longer works.

Minimal reproducible example

https://github.com/austin43/expo-router-layout-routing

image

It shows up in the sitemap, and is routable by editing the url to /modal, but pressing a <Link /> or router.push doesn't work.

Possibly related to #768. When I pull initialRouteName out, the routing works again as expected.

I'm seeing this too and I have a similar route structure to you where I have a parent route, a layout with a Slot, and then child routes. If I'm on the child route, using router.push or Link to the parent route will not navigate for me. My app does not use initialRouteName so your attempted fixed doesn't work for me.

image

The scenario I'm talking about attempts to go from /benefit/support/faqs to /benefit/support. This used to work with the previous expo-router version.