Ensure NavigationTransitioner props.onTransitionEnd happens after scene cleanup
Summary: We only want to call onTransitionEnd after the transition has fully completed, including scene cleanup. This will help avoid race conditions when we start new navigation after a transition completes. Reviewed By: fkgozali Differential Revision: D3712235 fbshipit-source-id: 146f30a0caf3d2fe164285fbef12293b7b161c6e
This commit is contained in:
parent
5b040a52c4
commit
de9d22ee7e
|
@ -217,12 +217,13 @@ class NavigationTransitioner extends React.Component<any, Props, State> {
|
|||
};
|
||||
|
||||
this._transitionProps = buildTransitionProps(this.props, nextState);
|
||||
this.setState(nextState);
|
||||
|
||||
this.props.onTransitionEnd && this.props.onTransitionEnd(
|
||||
this._transitionProps,
|
||||
prevTransitionProps,
|
||||
);
|
||||
this.setState(nextState, () => {
|
||||
this.props.onTransitionEnd && this.props.onTransitionEnd(
|
||||
this._transitionProps,
|
||||
prevTransitionProps,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue