@@ -70,14 +70,6 @@ function hasMatch(matches, match) {
70
70
} ) ;
71
71
}
72
72
73
- function updateMatchComponents ( matches , refs ) {
74
- var i = 0 , component ;
75
- while ( component = refs . __activeRoute__ ) {
76
- matches [ i ++ ] . component = component ;
77
- refs = component . refs ;
78
- }
79
- }
80
-
81
73
/**
82
74
* Computes the next state for the given component and calls
83
75
* callback(error, nextState) when finished. Also runs all
@@ -101,8 +93,6 @@ function computeNextState(component, transition, callback) {
101
93
102
94
var fromMatches , toMatches ;
103
95
if ( currentMatches . length ) {
104
- updateMatchComponents ( currentMatches , component . refs ) ;
105
-
106
96
fromMatches = currentMatches . filter ( function ( match ) {
107
97
return ! hasMatch ( nextMatches , match ) ;
108
98
} ) ;
@@ -219,6 +209,14 @@ function runHooks(hooks, callback) {
219
209
}
220
210
}
221
211
212
+ function updateMatchComponents ( matches , refs ) {
213
+ var i = 0 , component ;
214
+ while ( component = refs . __activeRoute__ ) {
215
+ matches [ i ++ ] . component = component ;
216
+ refs = component . refs ;
217
+ }
218
+ }
219
+
222
220
function returnNull ( ) {
223
221
return null ;
224
222
}
@@ -329,6 +327,8 @@ var Routes = React.createClass({
329
327
} else if ( abortReason ) {
330
328
this . goBack ( ) ;
331
329
} else {
330
+ updateMatchComponents ( this . state . matches , this . refs ) ;
331
+
332
332
this . updateScroll ( path , actionType ) ;
333
333
334
334
if ( this . props . onChange )
0 commit comments