-3

Question

I’m using Expo Router in a React Native app and ran into an issue with stack navigation.


Structure

app/
├── _layout.tsx          // Tabs
├── index.tsx            // Home tab
└── profile/
    ├── _layout.tsx      // Stack
    ├── index.tsx
    └── detail/[id].tsx

Issue

  • Navigating from profile/index → profile/detail/[id] works fine — back button appears.

  • I also have a quick action on the Home tab that goes directly to /profile/detail/123.

  • If the Profile tab hasn’t been opened yet, going directly to the detail page shows no back button, and I can’t return to profile/index.

It looks like Expo Router treats the detail page as the root of the stack when accessed directly.


Tried

  • initialRouteName="index" in profile/_layout.tsx

  • Nested <Stack> and <Tabs>

  • Pushing twice (/profile, then /profile/detail/[id]) — works but briefly flashes the index page.


Question

How can I make the stack always treat profile/index as its root — so the back button works — even when opening /profile/detail/[id] directly from another tab (like via a quick action or deep link)?


Env

  • Expo SDK: 54

  • React Native: 0.81

  • Expo Router: latest

Code base github link : https://github.com/abbassi-ahmed/expo-problem

Video:https://www.mediafire.com/file/y1ksoff9wpzd0ry/Simulator+Screen+Recording+-+iPhone+Air+-+2025-11-07+at+15.25.01.mov/file

1
  • 1
    Sorry, but people aren't going to study a whole project or watch a video to understand your issue. Everything needed to understand your problem must be here, in the question, not in links. Commented Nov 8 at 12:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.