-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested stack in tab navigator doesn't respect stack nesting in tabs as in react anvigation #530
Comments
The solution from @marklawlor seems correct.
Sure, but there will be some additional code required to make File-based routing work on native. Perhaps you can utilize the array syntax: ArraysInstead of defining the same route multiple times with different layouts, use the array syntax
Distinguishing between the two routes using the export default function DynamicLayout({ segment }) {
if (segment === "(search)") {
return <SearchStack />;
}
return <Stack />;
} e.g.
This has a lot of caveats though:
|
I put together a demo app https://github.com/EvanBacon/expo-router-twitter |
Screen.Recording.2023-05-19.at.05.38.32.movWhy is the tab structure broken when I rest the profile page in the Twitter example? I'm trying to set up a conjugate structure with my website. My category landing pages can take many forms. /jewelry/necklaces/best-products but I want to match them all in the same place.(exp: [...resolve].tsx) because there is no specific rule. It can be 2 or 3 or 5 or a single segment. I showed what I want to do in the example of Twitter, I would be very happy if you review and give feedback. |
i am having the same issue on my real app |
similar issue with shared routes, I'm following the Shared Routes guide (https://docs.expo.dev/router/advanced/shared-routes/), but the router is working as the screenshot above, that's not what I want |
Im fight with shared routes half of the day, figured out i can't use them as arrays, my behavior is the same as in developers above, I ended by copy paste [id].tsx in desired stacks. sadly. |
Which package manager are you using? (Yarn is recommended)
npm
Summary
As per this old bare bones simple shared below, a tab navigator in react-navigation with stacks inside -> when pushing in the nested stacks it both hides the tab bar and brings in the new header, making it the top contextual page
This discussion started here - but i don't think it sufficed: #518
^ in the above, this link is shared: https://reactnavigation.org/docs/hiding-tabbar-in-screens/ and in the exact expo example, what i am requesting works, but in expo-router, it does not.
I attempted the suggested solution at the bottom but then every single page now needs special custom header / tab bar / back button overrides, whereas in the past it worked automatically.
I think this is a super common scenario, needing stacks in tabs, wherein i need not worry about the all the above - this would be considered blocking upgrade for sure
Minimal reproducible example
There is an article that has example here - https://github.com/captainIN/tab_stack/tree/master
The text was updated successfully, but these errors were encountered: