mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-08 09:13:02 +08:00
Merge pull request #35 from Ashoat/master
Don't call onTransitionStart if unspecified
This commit is contained in:
@@ -101,12 +101,14 @@ class Transitioner extends React.Component {
|
||||
|
||||
if (!this._transitionProps.navigation.state.isTransitioning) {
|
||||
this.setState(nextState, async () => {
|
||||
const result = nextProps.onTransitionStart(
|
||||
this._transitionProps,
|
||||
this._prevTransitionProps
|
||||
);
|
||||
if (result instanceof Promise) {
|
||||
await result;
|
||||
if (nextProps.onTransitionStart) {
|
||||
const result = nextProps.onTransitionStart(
|
||||
this._transitionProps,
|
||||
this._prevTransitionProps
|
||||
);
|
||||
if (result instanceof Promise) {
|
||||
await result;
|
||||
}
|
||||
}
|
||||
progress.setValue(1);
|
||||
position.setValue(toValue);
|
||||
|
||||
Reference in New Issue
Block a user