fix: make rehydration keys stable

This commit is contained in:
satyajit.happy
2019-07-24 10:56:41 +02:00
parent 13b16b2d42
commit d6501d3e5d
7 changed files with 12 additions and 9 deletions

View File

@@ -91,7 +91,7 @@ function StackRouter(options: DefaultRouterOptions) {
};
},
getRehydratedState({ routeNames, partialState }) {
getRehydratedState({ key, routeNames, partialState }) {
let state = partialState;
if (state.stale) {
@@ -99,7 +99,7 @@ function StackRouter(options: DefaultRouterOptions) {
...state,
stale: false,
routeNames,
key: `stack-${shortid()}`,
key,
};
}