fix(react): unmount leaving view when using browser back button, fixes #19749 (#19781)

This commit is contained in:
Ely Lucas
2019-10-29 09:30:37 -06:00
parent 67737bbb54
commit 1f2b161ccd

View File

@ -100,11 +100,13 @@ class RouteManager extends React.Component<RouteComponentProps, RouteManagerStat
* record the view that originally directed to the new view for back button purposes.
*/
enteringView.prevId = enteringView.prevId || leavingView.id;
} else if (action === 'POP') {
direction = leavingView.prevId === enteringView.id ? 'back' : 'none';
} else {
direction = direction || 'back';
leavingView.mount = false;
}
} else if (action === 'REPLACE') {
} else if (direction === 'back' || action === 'REPLACE') {
leavingView.mount = false;
}
} else {