Browse files

Emit `willfocus` from immediatelyResetRouteStack

The Navigator component inconsistently emits the `willfocus` event.

While it is emitted in `Navigator#resetTo`, `Navigator#push`, `Navigator#pop` and event `Navigator#replaceAtIndex` it is not emitted from `Navigator#immediatelyResetRouteStack`. This leads to surprising inconsistencies when working with these events.

With the PR I suggest to emit the `willfocus` event before resetting the route stack.
Closes #10125

Differential Revision: D3931284

fbshipit-source-id: 6e4f45c6d38426bcd0acc8f8c39478524032a03a
  • Loading branch information...
1 parent b32a857 commit 95b1fc42b766b2146f51a1936cd915daecbd3e2f @dzautner dzautner committed with Facebook Github Bot 8 Sep 27, 2016
Showing with 1 addition and 0 deletions.
  1. +1 −0 Libraries/CustomComponents/Navigator/Navigator.js
@@ -484,6 +484,7 @@ var Navigator = React.createClass({
immediatelyResetRouteStack: function(nextRouteStack) {
var destIndex = nextRouteStack.length - 1;
+ this._emitWillFocus(nextRouteStack[destIndex]);
routeStack: nextRouteStack,

0 comments on commit 95b1fc4

Please sign in to comment.