I spent more than a day on this, and i bet it’s gonna be something dead simple.
So how do you navigate out of an IonTab, how do you change tabs if you have more?
I have a header on a page in a tab, i want the user to be able to go to a ( root ) login page.
Anything i tried i’m still in the context of the tab. I can see the bottom toolbar, i see every other tab on the DOM, hidden, but not the Login page component.
In angulars NavController module you can call the navController.navigateRoot(url: string) method, and it does the job.
What i tried:
history prop,
routerLink prop,
usehistory from react-router-dom,
Link from react-router-dom
useIonRouter from ionic/react,
navigate from NavContext ionic/react,
If your buttons are structured like this, you can change between tabs.
If you want to completely navigate away from all tabs, then you need to wrap the routes that should have tabs in a <IonTabBar> and exclude the routes that should not have tabs. There are a few examples of that if you search this forum.
Thanks for your reply, tt seems i wasn’t clear enough i am sorry.
This is my tab, I don’t have a problem navigating in between these two routes in my tab. I have a problem navigating away/out from lets say my map page, to a root page, or any other page whatsoever .
The app starts in a tab, login is secondary, but even if it would be the other way, I would still like to know how do you unmount a tab, how do you go from /tab/help to /anything or /otherTab/notHelp?
Solved it finally, it is insane how much contradiction is in the docs and in the different solutions. For me ,not using IonPage to wrap my Tabs and also ditching IonReactRouter in my Tabs and also wrapping my root IonRouterOutlet with an IonPage solved the problem.