fix: keep the routes we are closing or replacing

This commit is contained in:
satyajit.happy
2019-10-05 16:07:39 +02:00
parent 48f33a120e
commit dabd941128

View File

@@ -145,6 +145,16 @@ class StackView extends React.Component<Props, State> {
// i.e. the currently focused route already existed and the previously focused route still exists
// We don't know how to animate this
}
} else {
// Keep the routes we are closing or replacing
routes = routes.slice();
routes.splice(
routes.length - 1,
0,
...state.routes.filter(
({ key }) => replacing.includes(key) || closing.includes(key)
)
);
}
const descriptors = routes.reduce(