-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: IonRouterOutlet with routerLink does not unmount routes #20543
Comments
Similar/equal to #19984 |
This is by design. please see https://ionicframework.com/docs/react/navigation#ionrouteroutlet |
Hello @elylucas |
Yep, I will look into that. The idea is if you are leaving a page by going back, the state of the page no longer needs to be maintained. Contrast that by navigating between tabs or going forward from a list page to a details page, you want the same scroll position, form inputs, etc.. in place, so we keep those around in the dom and show/hide them via css. |
Yes, this makes sense. However the default behavior is misleading. Now, a large part of my app uses programmatical redirections, with Thanks a lot |
Ya, you can pass in the direction as a part of the state object (2nd param to
|
@elingerojo Thank you. This doesnt work for both version of the Redirect: <Route path={ origin } exact render={ () => <Redirect to={ target } /> } /> or <Redirect from={ origin } exact to={ target } /> This problem appears for version 4.11.5, 4.11.10 as well as 5.0.0. |
It seems that this problem has nothing to do with redirections, but nested IonRouterOutlets. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Bug Report
Ionic version:
5.0.0
Current behavior:
Leaving a page by clicking on
<IonButton routerLink="..">
does not unmount the route's component.Expected behavior:
The route component should be unmounted.
Steps to reproduce:
Other information:
Ionic info:
The text was updated successfully, but these errors were encountered: