@@ -143,20 +143,6 @@ type Event = Object;
143143 * });
144144 * ```
145145 *
146- * A navigation object contains the following functions:
147- *
148- * - `push(route)` - Navigate forward to a new route
149- * - `pop()` - Go back one page
150- * - `popN(n)` - Go back N pages at once. When N=1, behavior matches `pop()`
151- * - `replace(route)` - Replace the route for the current page and immediately
152- * load the view for the new route
153- * - `replacePrevious(route)` - Replace the route/view for the previous page
154- * - `replacePreviousAndPop(route)` - Replaces the previous route/view and
155- * transitions back to it
156- * - `resetTo(route)` - Replaces the top item and popToTop
157- * - `popToRoute(route)` - Go back to the item for a particular route object
158- * - `popToTop()` - Go back to the top item
159- *
160146 * Navigator functions are also available on the NavigatorIOS component:
161147 *
162148 * ```
@@ -492,6 +478,9 @@ var NavigatorIOS = React.createClass({
492478 this . navigationContext . emit ( 'willfocus' , { route : route } ) ;
493479 } ,
494480
481+ /**
482+ * Navigate forward to a new route
483+ */
495484 push : function ( route : Route ) {
496485 invariant ( ! ! route , 'Must supply route to push' ) ;
497486 // Make sure all previous requests are caught up first. Otherwise reject.
@@ -514,6 +503,9 @@ var NavigatorIOS = React.createClass({
514503 }
515504 } ,
516505
506+ /**
507+ * Go back N pages at once. When N=1, behavior matches `pop()`
508+ */
517509 popN : function ( n : number ) {
518510 if ( n === 0 ) {
519511 return ;
@@ -535,6 +527,9 @@ var NavigatorIOS = React.createClass({
535527 }
536528 } ,
537529
530+ /**
531+ * Go back one page
532+ */
538533 pop : function ( ) {
539534 this . popN ( 1 ) ;
540535 } ,
@@ -574,23 +569,30 @@ var NavigatorIOS = React.createClass({
574569 } ,
575570
576571 /**
577- * Replaces the top of the navigation stack.
572+ * Replace the route for the current page and immediately
573+ * load the view for the new route.
578574 */
579575 replace : function ( route : Route ) {
580576 this . replaceAtIndex ( route , - 1 ) ;
581577 } ,
582578
583579 /**
584- * Replace the current route's parent .
580+ * Replace the route/view for the previous page .
585581 */
586582 replacePrevious : function ( route : Route ) {
587583 this . replaceAtIndex ( route , - 2 ) ;
588584 } ,
589585
586+ /**
587+ * Go back to the top item
588+ */
590589 popToTop : function ( ) {
591590 this . popToRoute ( this . state . routeStack [ 0 ] ) ;
592591 } ,
593592
593+ /**
594+ * Go back to the item for a particular route object
595+ */
594596 popToRoute : function ( route : Route ) {
595597 var indexOfRoute = this . state . routeStack . indexOf ( route ) ;
596598 invariant (
@@ -601,6 +603,9 @@ var NavigatorIOS = React.createClass({
601603 this . popN ( numToPop ) ;
602604 } ,
603605
606+ /**
607+ * Replaces the previous route/view and transitions back to it.
608+ */
604609 replacePreviousAndPop : function ( route : Route ) {
605610 // Make sure all previous requests are caught up first. Otherwise reject.
606611 if ( this . state . requestedTopOfStack !== this . state . observedTopOfStack ) {
@@ -618,6 +623,9 @@ var NavigatorIOS = React.createClass({
618623 } ) ;
619624 } ,
620625
626+ /**
627+ * Replaces the top item and popToTop
628+ */
621629 resetTo : function ( route : Route ) {
622630 invariant ( ! ! route , 'Must supply route to push' ) ;
623631 // Make sure all previous requests are caught up first. Otherwise reject.
@@ -628,7 +636,7 @@ var NavigatorIOS = React.createClass({
628636 this . popToRoute ( route ) ;
629637 } ,
630638
631- handleNavigationComplete : function ( e : Event ) {
639+ _handleNavigationComplete : function ( e : Event ) {
632640 if ( this . _toFocusOnNavigationComplete ) {
633641 this . _getFocusEmitter ( ) . emit ( 'focus' , this . _toFocusOnNavigationComplete ) ;
634642 this . _toFocusOnNavigationComplete = null ;
@@ -663,7 +671,7 @@ var NavigatorIOS = React.createClass({
663671 ) ;
664672 } ,
665673
666- renderNavigationStackItems : function ( ) {
674+ _renderNavigationStackItems : function ( ) {
667675 var shouldRecurseToNavigator =
668676 this . state . makingNavigatorRequest ||
669677 this . state . updatingAllIndicesAtOrBeyond !== null ;
@@ -678,7 +686,7 @@ var NavigatorIOS = React.createClass({
678686 style = { styles . transitioner }
679687 vertical = { this . props . vertical }
680688 requestedTopOfStack = { this . state . requestedTopOfStack }
681- onNavigationComplete = { this . handleNavigationComplete } >
689+ onNavigationComplete = { this . _handleNavigationComplete } >
682690 { items }
683691 </ NavigatorTransitionerIOS >
684692 </ StaticContainer >
@@ -688,7 +696,7 @@ var NavigatorIOS = React.createClass({
688696 render : function ( ) {
689697 return (
690698 < View style = { this . props . style } >
691- { this . renderNavigationStackItems ( ) }
699+ { this . _renderNavigationStackItems ( ) }
692700 </ View >
693701 ) ;
694702 } ,
0 commit comments