Open raudonikis opened 2 years ago
In the documentation it says you are supposed to use CurrentTab
instead of CurrentScreen
when using TabNavigator
.
Not sure if related to your issue but worth a shot.
In the documentation it says you are supposed to use
CurrentTab
instead ofCurrentScreen
when usingTabNavigator
.Not sure if related to your issue but worth a shot.
Same issues with CurrentScreen
and CurrentTab
.
I too am wondering how to do this. There doesn't seem to be a way to retrieve the parent Navigator when inside the TabNavigator's content since LocalNavigator.current will just return the TabNavigator's Navigator. The only way I've seen is to pass the parent Screen's Navigator to the children Tabs.
@raudonikis check my test project https://github.com/zakrodionov/PracticalApp/tree/feature/compose_voyager_navigation I just did something similar recently.
Any update on this? I'm struggling with the issue when you pop the main navigator and you get the initial tab screen. I've created mini project: https://github.com/mkowol-n/voyagernav and i've noticed something.
Navigate to 2nd tab, navigate from red screen to white screen, go navigate to 1st tab. Now: Navigate from blackScreen to GreenScreen and then to YellowScreen. Press back button (you see black screen instead of greenscreen. However when you switch to 2nd tab - it didnt reset. It stays on white screen. So there has to be a bug somewhere in the voyager code, but i'm not sure where.
Btw: Same happens switch 1st tab with 2nd tab in the description above.
It happens even without using TabNavigator, just nested Navigators. This problem doesn't seem to be related to tabs or anything like that, simply because there are nested Navigators. I hope anyone can solve it soon.
I can't figure out how to have a top level Navigator that can navigate between basic screens, and a screen with a TabNavigator inside. Example use case, authentication flow:
SignIn
screen;Main
screen -> TabNavigator with BottomNavigation.What I've tried:
MainActivity
:MainScreen
:Navigation happens successfully, but for some reason it loses the Theme (dark theme becomes light theme), and also the state of the TabNavigator's last tab (if I navigate back, the Tab resets to the very first destination). Is there a better approach for handling this use case?