@@ -482,21 +482,18 @@ function createRouter(options) {
482
482
children : PropTypes . falsy
483
483
} ,
484
484
485
- getLocation : function ( ) {
486
- return location ;
487
- } ,
488
-
489
- getScrollBehavior : function ( ) {
490
- return scrollBehavior ;
491
- } ,
492
-
493
- getRouteAtDepth : function ( depth ) {
494
- var routes = this . state . routes ;
495
- return routes && routes [ depth ] ;
485
+ childContextTypes : {
486
+ getRouteAtDepth : React . PropTypes . func . isRequired ,
487
+ setRouteComponentAtDepth : React . PropTypes . func . isRequired ,
488
+ routeHandlers : React . PropTypes . array . isRequired
496
489
} ,
497
490
498
- setRouteComponentAtDepth : function ( depth , component ) {
499
- mountedComponents [ depth ] = component ;
491
+ getChildContext : function ( ) {
492
+ return {
493
+ getRouteAtDepth : this . getRouteAtDepth ,
494
+ setRouteComponentAtDepth : this . setRouteComponentAtDepth ,
495
+ routeHandlers : [ this ]
496
+ } ;
500
497
} ,
501
498
502
499
getInitialState : function ( ) {
@@ -511,23 +508,26 @@ function createRouter(options) {
511
508
Router . stop ( ) ;
512
509
} ,
513
510
514
- render : function ( ) {
515
- var route = this . getRouteAtDepth ( 0 ) ;
516
- return route ? React . createElement ( route . handler , this . props ) : null ;
511
+ getLocation : function ( ) {
512
+ return location ;
517
513
} ,
518
514
519
- childContextTypes : {
520
- getRouteAtDepth : React . PropTypes . func . isRequired ,
521
- setRouteComponentAtDepth : React . PropTypes . func . isRequired ,
522
- routeHandlers : React . PropTypes . array . isRequired
515
+ getScrollBehavior : function ( ) {
516
+ return scrollBehavior ;
523
517
} ,
524
518
525
- getChildContext : function ( ) {
526
- return {
527
- getRouteAtDepth : this . getRouteAtDepth ,
528
- setRouteComponentAtDepth : this . setRouteComponentAtDepth ,
529
- routeHandlers : [ this ]
530
- } ;
519
+ getRouteAtDepth : function ( depth ) {
520
+ var routes = this . state . routes ;
521
+ return routes && routes [ depth ] ;
522
+ } ,
523
+
524
+ setRouteComponentAtDepth : function ( depth , component ) {
525
+ mountedComponents [ depth ] = component ;
526
+ } ,
527
+
528
+ render : function ( ) {
529
+ var route = this . getRouteAtDepth ( 0 ) ;
530
+ return route ? React . createElement ( route . handler , this . props ) : null ;
531
531
}
532
532
533
533
} ) ;
0 commit comments