Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react): unmount leaving view when using browser back button, fixes …
- Loading branch information
1 parent
9372eaf
commit 8b29e09
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8b29e09
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I am using ionic react version 6.8.0, and I found you still have this kind of issue.
Assume we have page 1 pushing to page 2, page 2 pushing to page 3. The issue happens in this pseudo code:
In page 1:
history.push({
pathname: "page2",
state: {value:1}
});
In page 2:
history.push("page 3");
When navigate back from page 3 to page 2 using history.goBack(); , you can clearly see the action is PUSH instead of POP.
The bug is page 2 was pushed with a state, thus in your code, although setState {direction: "back"} previously, in the end it was replaced by the state {value: 1}, making wrong animation direction.
It can be visible by console.log every history in each page and check the location.state.
Please fix it as soon as possible, which causing push/pop nearly not usable in mobile.