bug: Nested routes in tabs not working
See original GitHub issueBug Report
Ionic version:
[ ] 4.x [x] 5.x
Current behavior:
https://ionicframework.com/docs/react/navigation#nested-routes
The example in the link works fine. But it doesn’t work when used in tabs. Note: Tab Button does not work when clicked. It works if you go directly to the link. (/settings)
Expected behavior:
Example: Creating different routes within the Settings tab. (Settings > Notifications)
Steps to reproduce:
Related code:
<IonReactRouter>
<IonTabs>
<IonRouterOutlet>
<Route path="/settings" render={props => <SettingsPage {...props} />} />
</IonRouterOutlet>
<IonTabBar slot="bottom">
<IonTabButton tab="tab1" href="/settings">
<IonIcon icon={triangle} />
<IonLabel>Settings</IonLabel>
</IonTabButton>
</IonTabBar>
</IonTabs>
</IonReactRouter>
const SettingsPage: React.FC<RouteComponentProps> = ({match}) => {
return (
<IonRouterOutlet>
<Route path={`${match.url}/notifications`} component={NotificationsPage} />
</IonRouterOutlet>
);
};
Other information:
Ionic info:
Ionic:
Ionic CLI : 6.15.0
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v14.15.2
npm : 6.14.9
OS : Windows 10
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
[Bug]: Nested routes not working fine #9376 - GitHub
I was trying to solve for using the nested routes and handlers to build breadCrumbs, and the nesting could go deeper. I had...
Read more >Ionic nested routes and tabs not working as expected
Hi, We have an application with 4 tabs each having nested routes. Ex. of routes tab1/childPage1/childPage2 tab2/childPage1/ from tab1 we ...
Read more >unable to create triple nested routes in react router with ...
I'm trying to create triple nesting with react-router but it's not working. Here is the expected output enter image description here ...
Read more >Migrating to React Router v6: A complete guide
The v5 library has some issues with the routing algorithm and ... For developing nested routes, developers had to use write more code...
Read more >auto_route | Flutter Package - Pub.dev
Declarative Navigation; Working with Paths; Route guards; Wrapping routes ... a nested route every-time the tab changes and that might work but our...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Glad both issues are resolved!
https://github.com/ionic-team/ionic-framework/issues/23408
this problem is also solved. Nested routes are automatically removed from the dom.