Merge pull request #35 from Ashoat/master

Don't call onTransitionStart if unspecified
This commit is contained in:
Eric Vicenti
2018-10-09 11:54:18 -07:00
parent c39f5c5f17
commit 327ca0bbe4

View File

@@ -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);