I have an Ionic React app (v5) with several dozen pages and three tabs.
I’ve noticed that some pages show up as part of one of the three tabs (for example, navigating to the page, going to a different tab, and then returning to the original tab restores that page), while other pages are not attached to any tabs at all.
What determines which pages are attached to which tabs?
Creating a basic
tabs React app will give you the answer to your Q:
Thanks, but I already did that and used it as a template to build my app. I still don’t understand why some pages are associated with a tab and others are not.
some code would be helpful is resolving your issue?
Yes, a code example with a tab and multiple pages associated with the tab would be great.
One of my tabs has all of the pages it links to associated with it, but another tab does not have any of the pages it links to associated with it-- I want to know how to say “this route belongs to this tab.”
I don’t know what you expect someone to do with that response? If you can provide some code, I am happy to assist
Thanks, I’m sorry I wasn’t clear.
Actually, I was able to solve the problem myself after more experimentation.
Here’s the issue:
Tab Fruits, url: /fruits/welcome
Tab Vegetables, url: /vegetables
With this configuration, if you go to the Vegetables tab → Broccoli page, then go to the Fruits tab, then go back to the Vegetables tab, you will see Broccoli. This is the intended behavior.
But, if you go to the Fruits tab → Apple page, then go to the Vegetables tab, then go back to the Fruits tab, you will be on the Fruits tab main page, not Apple. This is because the
/welcome part of the Fruits tab path breaks the association with the other fruit pages. To fix this, I had to remove the
/welcome from the tab URL.