Skip to content

Commit

Permalink
[ReactNative] Navigator focus handler context fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Vicenti committed May 2, 2015
1 parent 43e0388 commit 28e6e99
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Libraries/CustomComponents/Navigator/Navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,13 @@ var Navigator = React.createClass({
initialRouteStack: PropTypes.arrayOf(PropTypes.object),

/**
* Will emit the target route upon mounting and before each nav transition,
* overriding the handler in this.props.navigator. This overrides the onDidFocus
* handler that would be found in this.props.navigator
* Will emit the target route upon mounting and before each nav transition
*/
onWillFocus: PropTypes.func,

/**
* Will be called with the new route of each scene after the transition is
* complete or after the initial mounting. This overrides the onDidFocus
* handler that would be found in this.props.navigator
* complete or after the initial mounting
*/
onDidFocus: PropTypes.func,

Expand Down Expand Up @@ -601,7 +598,8 @@ var Navigator = React.createClass({
this._lastDidFocus = route;
if (this.props.onDidFocus) {
this.props.onDidFocus(route);
} else if (this.parentNavigator && this.parentNavigator.onDidFocus) {
}
if (this.parentNavigator && this.parentNavigator.onDidFocus) {
this.parentNavigator.onDidFocus(route);
}
},
Expand All @@ -617,7 +615,8 @@ var Navigator = React.createClass({
}
if (this.props.onWillFocus) {
this.props.onWillFocus(route);
} else if (this.parentNavigator && this.parentNavigator.onWillFocus) {
}
if (this.parentNavigator && this.parentNavigator.onWillFocus) {
this.parentNavigator.onWillFocus(route);
}
},
Expand Down

0 comments on commit 28e6e99

Please sign in to comment.