My routing with tabs recently stopped working on upgrading my libraries.
"@ionic/react": "^5.3.1",
"@ionic/react-router": "^5.3.1",
The code is…
<IonTabs>
<IonRouterOutlet>
<Route path="/my/home" component={Home} exact />
<Route path="/my/birthdays/list" component={BirthdayList} exact />
<Route path="/my/birthdays/add" component={AddBirthday} exact />
<Route path="/my/birthdays/view/:key" component={ViewBirthday} exact />
<Route path="/my/birthdays/edit/:key" component={EditBirthday} exact />
<Route path="/my/profile" component={Profile} exact />
</IonRouterOutlet>
<IonTabBar slot="bottom" id="tabs">
<IonTabButton tab="home" href="/my/home">
<IonIcon icon={homeOutline} />
</IonTabButton>
<IonTabButton tab="birthdays" href="/my/birthdays/list">
<IonIcon icon={listOutline} />
</IonTabButton>
<IonTabButton tab="profile" href="/my/profile">
<IonIcon icon={personOutline} />
</IonTabButton>
</IonTabBar>
</IonTabs>
From the docs I see that the path has a pretty different syntax.
<IonRouterOutlet>
<Route path="/:tab(sessions)" component={SessionsPage} exact={true} />
<Route path="/:tab(sessions)/:id" component={SessionDetail} />
<Route path="/:tab(speakers)" component={SpeakerList} exact={true} />
</IonRouterOutlet>
It’s not clear to me how to re-write my component with this new syntax.
Like for the home tab, would it be like
<Route path="/:tab(home)" component={Home} exact />
?
If I wanted to route from another page directly to that Home tab, could I still goto /my/home
?