-
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
Navigation reset on nested Layout inside Slot #586
Comments
It seems to be related to absolute path usage, if i use a relative path everything works fine, but it still seems to be a strange behaviour, idk. I will update the example to provide something that works fine, so we can compare the different results |
I have added an example here: https://github.com/DavideSegullo/expo-router-mre/tree/fix It works a little better now, but the error is if there is nested navigation like this, you lose the reference to the parent, in my opinion and so as a result the routes then do not mount correctly |
@DavideSegullo I can't make sense of which part of this repo to look at. |
Inside in the main branch, I have created two routes (guest) and private, I have a _layout.tsx file in the root that decides which one to go to. Within the tabs view, you can navigate to subpages using a stack navigation, but the error, as per the video, is that if I don't specify a relative path but do a push of a route using an absolute path, the routing always resets to the first Tab, as seen in the video, the code used is pretty much the same as the example you made for Twitter, I just added that layout in the root. Thank you |
I tried to make an example similar to the one here in your twitter application. 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 have a similar sounding issue that's a lot more simple to replicate: I have a nested layout where an absolute link to '/' in the subfolder ends up pointing to the subfolder's index page rather than the root of the site (this is on web). |
Can you at least let us know if you need more info to fix this? It's present in both expo router 1 and 2. |
Possibly related to #365 |
Same here. |
This is correct. A side-effect of shared routes (very advanced feature) is that you must either use relative paths or absolute paths with This is not a bug, but you do need to be considerate of the |
Are there any solutions for this issue? I've encountered the same and can't seem to resolve it. |
I think I'm also encountering this. I have tabs nested inside of a stack and a modal. If I switch tabs then navigate to elsewhere in the stack outside of the tabs when I call |
OK I think I figured it out. It seems to be a quirk or bug with routes not being picked up correctly from filesystem structure. If I ensure that I've defined every route ahead of time (that is, a |
Which package manager are you using? (Yarn is recommended)
npm
Summary
Hi all, I am making an app from this example: expo router twitter.
I am trying to insert two separate areas, one private and one for guest users, at the moment I simulate the login by making a redirect at the beginning.
Mal the moment I go to use the tabs navigation with the stack navigation, I notice an unusual behavior, in fact, as seen in the video, if I click on an item that should take the user back to a subpage while keeping the tab active, the navigation is reset.
screen-record.mov
Thank you
Minimal reproducible example
Here you can find a minimal reproducible example.
The text was updated successfully, but these errors were encountered: