mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-30 05:15:25 +08:00
fix: only remove non-existed routes from tab history. closes #8567
This commit is contained in:
@@ -244,8 +244,9 @@ export default function TabRouter({
|
||||
routeNames.indexOf(state.routes[state.index].name)
|
||||
);
|
||||
|
||||
let history = state.history.filter((it) =>
|
||||
routes.find((r) => r.key === it.key)
|
||||
let history = state.history.filter(
|
||||
// Type will always be 'route' for tabs, but could be different in a router extending this (e.g. drawer)
|
||||
(it) => it.type !== 'route' || routes.find((r) => r.key === it.key)
|
||||
);
|
||||
|
||||
if (!history.length) {
|
||||
|
||||
Reference in New Issue
Block a user