Avoid completion dispatch when nav state changed
This commit is contained in:
parent
1aa8ca38d5
commit
3fc590353f
|
@ -33,10 +33,15 @@ class StackView extends React.Component {
|
|||
const { navigationConfig, navigation } = this.props;
|
||||
const onTransitionEnd =
|
||||
this.props.onTransitionEnd || navigationConfig.onTransitionEnd;
|
||||
if (transition.navigation.state.isTransitioning) {
|
||||
const transitionDestKey = transition.scene.route.key;
|
||||
const isCurrentKey =
|
||||
navigation.state.routes[navigation.state.index].key ===
|
||||
transitionDestKey;
|
||||
if (transition.navigation.state.isTransitioning && isCurrentKey) {
|
||||
navigation.dispatch(
|
||||
StackActions.completeTransition({
|
||||
key: navigation.state.key,
|
||||
toChildKey: transitionDestKey,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue