mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-23 12:07:35 +08:00
refactor: mark initial state as stale to determine when to rehydrate (#23)
This commit is contained in:
committed by
Michał Osadnik
parent
2798c93e8b
commit
bd6aa667cb
@@ -72,9 +72,10 @@ const TabRouter: Router<Action | CommonAction> = {
|
||||
getRehydratedState({ routeNames, partialState }) {
|
||||
let state = partialState;
|
||||
|
||||
if (state.routeNames === undefined || state.key === undefined) {
|
||||
if (state.stale) {
|
||||
state = {
|
||||
...state,
|
||||
stale: false,
|
||||
routeNames,
|
||||
key: `tab-${shortid()}`,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user