mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-10 22:47:02 +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
@@ -86,9 +86,10 @@ const StackRouter: Router<CommonAction | Action> = {
|
||||
getRehydratedState({ routeNames, partialState }) {
|
||||
let state = partialState;
|
||||
|
||||
if (state.routeNames === undefined || state.key === undefined) {
|
||||
if (state.stale) {
|
||||
state = {
|
||||
...state,
|
||||
stale: false,
|
||||
routeNames,
|
||||
key: `stack-${shortid()}`,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user