Skip to content

Commit d8a4a64

Browse files
committed
Removed refetch on history navigation
On a master/details scene don't want the master list to refetch on history navigation because then it could be out of step with the details - the selected details might not be in the top 10 anymore, for example. Also, common to programmatically pop browser history when closing modal - would be bad if the master list was different. Safest not to refetch on history navigation. Also better for mobile where there's no need to refetch - the crumb scenes are already rendered in the stack.
1 parent 07ddc2d commit d8a4a64

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

NavigationReact/src/NavigationHandler.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,9 @@ class NavigationHandler extends Component<{ stateNavigator: StateNavigator, chil
2727
const { stateNavigator } = this.props;
2828
const { stateContext } = stateNavigator;
2929
if (this.state.context.stateNavigator.stateContext !== stateContext) {
30-
const { history, oldState, state, data, asyncData } = stateContext;
30+
const { oldState, state, data, asyncData } = stateContext;
3131
const asyncNavigator = new AsyncStateNavigator(this, stateNavigator, stateContext);
32-
const startTransition = React.startTransition || ((transition) => transition());
33-
this.setState({ context: { oldState, state, data, asyncData, stateNavigator: asyncNavigator } }, () => {
34-
if (stateNavigator.stateContext === stateContext && history) {
35-
startTransition(() => {
36-
this.setState({ context: { ignoreCache: true, oldState, state, data, asyncData, stateNavigator: asyncNavigator } });
37-
});
38-
}
39-
});
32+
this.setState({ context: { oldState, state, data, asyncData, stateNavigator: asyncNavigator } });
4033
}
4134
}
4235

0 commit comments

Comments
 (0)