@@ -288,7 +288,7 @@ var Routes = React.createClass({
288
288
this . _handleStateChange = this . handleStateChange . bind ( this , path , actionType ) ;
289
289
this . setState ( nextState ) ;
290
290
}
291
- } . bind ( this ) ) ;
291
+ } ) ;
292
292
} ,
293
293
294
294
handleStateChange : function ( path , actionType ) {
@@ -340,15 +340,16 @@ var Routes = React.createClass({
340
340
toMatches = nextMatches ;
341
341
}
342
342
343
+ var callbackScope = this ;
343
344
var query = Path . extractQuery ( path ) || { } ;
344
345
345
346
runTransitionFromHooks ( fromMatches , transition , function ( error ) {
346
347
if ( error || transition . isAborted )
347
- return callback ( error , transition . abortReason ) ;
348
+ return callback . call ( callbackScope , error , transition . abortReason ) ;
348
349
349
350
runTransitionToHooks ( toMatches , transition , query , function ( error ) {
350
351
if ( error || transition . isAborted )
351
- return callback ( error , transition . abortReason ) ;
352
+ return callback . call ( callbackScope , error , transition . abortReason ) ;
352
353
353
354
var matches = currentMatches . slice ( 0 , currentMatches . length - fromMatches . length ) . concat ( toMatches ) ;
354
355
var rootMatch = getRootMatch ( matches ) ;
@@ -357,7 +358,7 @@ var Routes = React.createClass({
357
358
return match . route ;
358
359
} ) ;
359
360
360
- callback ( null , null , {
361
+ callback . call ( callbackScope , null , null , {
361
362
path : path ,
362
363
matches : matches ,
363
364
activeRoutes : routes ,
0 commit comments