Skip to content
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: @ionic/react-router not go back expected #19748

Closed
zawaliang opened this issue Oct 25, 2019 · 10 comments
Closed

bug: @ionic/react-router not go back expected #19748

zawaliang opened this issue Oct 25, 2019 · 10 comments
Assignees
Labels
package: react @ionic/react package type: bug a confirmed bug report

Comments

@zawaliang
Copy link

zawaliang commented Oct 25, 2019

Bug Report

Ionic version:
4.11.2

Current behavior:
At root page A, I redirect to page B, then C, then B again, when I go back, it go to root page A

Expected behavior:
It should not skip page C, it should go B>C>B>A

Other information:
I think the reason is @ionic/react-router maintain only a DOM node for each route pattern, when I visit the same route already in DOM, it will change the DOM‘s visibility

I fix the problem by this https://github.com/zawaliang/ionic-react-router-fix/blob/master/index.js
I maintain each DOM node for each page, not for route pattern, it works; but it may has some unexpected problems, so I wish it should be fixed in next version.

@ionitron-bot ionitron-bot bot added the triage label Oct 25, 2019
@liamdebeasi
Copy link
Contributor

Thanks for the issue. I am able to reproduce this. We will look into a fix!

@liamdebeasi liamdebeasi added package: react @ionic/react package type: bug a confirmed bug report labels Oct 25, 2019
@ionitron-bot ionitron-bot bot removed the triage label Oct 25, 2019
@elylucas
Copy link
Contributor

Hello, this issue should be fixed in 4.11.3. Please give it a try and if you find more issues, comment here and we can reopen this issue.

@aykamko
Copy link

aykamko commented Oct 30, 2019

Still experiencing this issue with 4.11.3

@elylucas
Copy link
Contributor

Thanks, we will look into this one further.

@elylucas
Copy link
Contributor

elylucas commented Nov 7, 2019

ok, think this is resolved now in 4.11.4, give it a try and let me know @aykamko, @zawaliang

@aykamko
Copy link

aykamko commented Nov 7, 2019

The bug appears to be resolved! Thank you!

@zawaliang
Copy link
Author

Thank you, the location stack is fixed.

But what I want is to keep every page state when I go back; but now when I go back, the page which be visited twice or more will render again。

eg:
from: A->B1->C->B2
B1 and B2 are the same route page, maybe has different url params, when go back from B2 to C, the B2 page wil remove from DOM, so when go back from C to B1, the B1 page will rebuild, the state will lost

@marcoromag
Copy link

Hi @zawaliang, I think this is due to the fact that B1 and B2 share the same ViewItem in the Ionic ViewStack. see #19891

@zawaliang
Copy link
Author

@marcoromag Yes, it needs to be optimized

@ionitron-bot
Copy link

ionitron-bot bot commented Dec 14, 2019

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Dec 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: react @ionic/react package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

5 participants