I’m having some weird behaviours caused by the NavSegment of the ion-tabs component, and I was wondering what was that segment for.
The main page of my app has tabs at the bottom. I have a use case where I need to reload all the data, including the tabs, so I’m doing:
Where “MainMenuPage” is the page that holds the tabs and rootNavCtrl is the root NavController of my app. When I do this, the page that is active when this command is executed is instantiated again without any NavParam, causing an exception in my code because it expects some params.
So imagine that my navigation stack is:
CoreMainMenuPage > SecondPage > ThirdPage
If I execute the line above while being in ThirdPage, when the new CoreMainMenuPage is loaded then the class ThirdPage is instantiated again without no NavParams.
I debugged this and the problem is in this line. The tabs of the new view retrieve a segment that points to the page that was active (in the example above, ThirdPage), so that page is created again.
So my question is, what’s the purpose of this segment? Is there any way to avoid using it?