Skip to content

Commit

Permalink
Merge pull request #10 from summer88123/master
Browse files Browse the repository at this point in the history
Fix: Check navigation props in InnerNaviBar.
  • Loading branch information
shallot authored Feb 13, 2019
2 parents 55bf97f + 0ab5636 commit 745a701
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/navibar.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ export class InnerNaviBar extends React.PureComponent {
left: null,
right: null,
};
this._didFocusSubscription = props.navigation.addListener('didFocus',
this._didFocusSubscription = props.navigation && props.navigation.addListener('didFocus',
() => BackHandler.addEventListener('hardwareBackPress', this._clickBack));
}

componentDidMount() {
this._willBlurSubscription = this.props.navigation.addListener('willBlur',
this._willBlurSubscription = this.props.navigation && this.props.navigation.addListener('willBlur',
() => BackHandler.removeEventListener('hardwareBackPress', this._clickBack));
Dimensions.addEventListener('change', this._onWindowChanged);
}
Expand Down

0 comments on commit 745a701

Please sign in to comment.